示例#1
0
文件: PluginTest.php 项目: visor/nano
 /**
  * @cover \Nano\Controller\Plugin
  */
 public function testPluginMethodsShouldRuns()
 {
     self::assertNull($this->controller->run('example'));
     self::assertTrue($this->initWasRun);
     self::assertTrue($this->beforeWasRun);
     self::assertTrue($this->afterWasRun);
 }
示例#2
0
文件: Dispatcher.php 项目: visor/nano
 /**
  * @return string
  * @param \Nano\Route\Common $route
  */
 public function run(\Nano\Route\Common $route)
 {
     if ($route instanceof \Nano\Route\Runnable) {
         /* @var $route \Nano\Route\Runnable */
         $route->run();
         return null;
     }
     $this->buildParams($route->params());
     $this->controllerInstance = $this->getController($route);
     $this->controllerInstance->setResponse($this->getResponse());
     if ($this->param('context')) {
         $this->controllerInstance->context = $this->param('context');
     }
     $this->controllerInstance->run($this->action());
 }