测试接收路径
  $app->get(
  '/post',
  function () {
  echo 'This is a POST route';
  }
  );
  输入http://localhost/lims/index.php/post路径
  出现This is a POST route
  测试display
$app->get('/bar', function (){
// echo $_SERVER['SCRIPT_NAME'];
// echo $_SERVER['PHP_SELF'];
//<-- Should not be in response body!
// $app->redirect($_SERVER['SCRIPT_NAME'].'/');
$view = new SlimView();
$prop1 = new ReflectionProperty($view, 'data');
$prop1->setAccessible(true);
$prop1->setValue($view, new SlimHelperSet(array('foo' => 'bar','ss'=>array('foo'=>'barsss'))));
$prop2 = new ReflectionProperty($view, 'templatesDirectory');
$prop2->setAccessible(true);
$prop2->setValue($view, dirname(__FILE__) . '/tests/templates');
$view->display('test.php');
});
  输入http://localhost/lims/index.php/bar
  出现test output barsss
  正常
  测试redirect
  $app->get('/bar', function (){
  $app->redirect($_SERVER['SCRIPT_NAME'].'/');
  });
  出现主页面,正常,slim框架几百k,用起来还是不错的。
  代码地址http://pan.baidu.com/s/1bnpTY71