예제 #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
파일: Render.php 프로젝트: visor/nano
 /**
  * @return string
  * @param \Nano\Controller $object
  */
 public function render(\Nano\Controller $object)
 {
     $module = $object->getModule();
     $variables = get_object_vars($object);
     $content = $this->renderView($module, $object->controller, $object->template, $object->context, $variables);
     if (null === $object->layout) {
         return $content;
     }
     $variables['content'] = $content;
     $layoutFile = $this->getLayoutFileName($object->layout, $object->context);
     return self::file($this, $layoutFile, $variables);
 }
예제 #3
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());
 }