当前位置: 首页>>代码示例>>PHP>>正文


PHP Slim::router方法代码示例

本文整理汇总了PHP中Slim::router方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::router方法的具体用法?PHP Slim::router怎么用?PHP Slim::router使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Slim的用法示例。


在下文中一共展示了Slim::router方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDefaultInstanceProperties

 /**
  * Test default instance properties
  */
 public function testDefaultInstanceProperties()
 {
     $s = new Slim();
     $this->assertInstanceOf('Slim_Http_Request', $s->request());
     $this->assertInstanceOf('Slim_Http_Response', $s->response());
     $this->assertInstanceOf('Slim_Router', $s->router());
     $this->assertInstanceOf('Slim_View', $s->view());
     $this->assertInstanceOf('Slim_Log', $s->getLog());
     $this->assertEquals(Slim_Log::DEBUG, $s->getLog()->getLevel());
     $this->assertTrue($s->getLog()->getEnabled());
     $this->assertInstanceOf('Slim_Environment', $s->environment());
 }
开发者ID:raynaldmo,项目名称:php-education,代码行数:15,代码来源:SlimTest.php

示例2: testSlimInit

 /**
  * Test Slim initialization
  *
  * Pre-conditions:
  * You have initialized a Slim application without specifying
  * a custom View class.
  *
  * Post-conditions:
  * Slim should have a default Not Found handler that is callable;
  * Slim should have a default Error hanlder that is callable;
  * Slim should have a default View
  */
 public function testSlimInit() {
     Slim::init();
     $this->assertTrue(is_callable(Slim::router()->notFound()));
     $this->assertTrue(is_callable(Slim::router()->error()));
     $this->assertTrue(Slim::view() instanceof Slim_View);
     $this->assertEquals('20 minutes', Slim::config('cookies.lifetime'));
 }
开发者ID:ntdt,项目名称:Slim,代码行数:19,代码来源:SlimTest.php

示例3: testSlimInitialization

 /**
  * Test Slim initialization
  *
  * Pre-conditions:
  * You have initialized a Slim application
  *
  * Post-conditions:
  * Slim should have a default NotFound handler that is callable;
  * Slim should have a View
  */
 public function testSlimInitialization()
 {
     Slim::init();
     $this->assertTrue(is_callable(Slim::router()->notFound()));
     $this->assertTrue(Slim::view() instanceof View);
 }
开发者ID:kolanos,项目名称:Slim,代码行数:16,代码来源:SlimTest.php

示例4: testGetCurrentRoute

 /**
  * Test get current route
  */
 public function testGetCurrentRoute()
 {
     Slim_Environment::mock(array('REQUEST_METHOD' => 'GET', 'SCRIPT_NAME' => '', 'PATH_INFO' => '/foo'));
     $app = new Slim();
     $route1 = $app->get('/bar', function () {
         echo "Bar";
     });
     $route2 = $app->get('/foo', function () {
         echo "Foo";
     });
     $app->call();
     $this->assertSame($route2, $app->router()->getCurrentRoute());
 }
开发者ID:sjakk,项目名称:betatext,代码行数:16,代码来源:RouterTest.php

示例5: testSlimAccessors

 public function testSlimAccessors()
 {
     $app = new Slim();
     $this->assertTrue($app->request() instanceof Slim_Http_Request);
     $this->assertTrue($app->response() instanceof Slim_Http_Response);
     $this->assertTrue($app->router() instanceof Slim_Router);
 }
开发者ID:inscriptionweb,项目名称:lebonmail,代码行数:7,代码来源:SlimTest.php


注:本文中的Slim::router方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。