예제 #1
0
파일: Controller.php 프로젝트: visor/nano
 /**
  * @return void
  */
 protected function runContextAction()
 {
     if (!$this->context) {
         return;
     }
     $method = \Nano\Application\Dispatcher::formatName($this->dispatcher()->action() . '-' . $this->context, false);
     if (!method_exists($this, $method)) {
         return;
     }
     $this->{$method}();
 }
예제 #2
0
 public function testActionsNamesFormatting()
 {
     $this->assertEquals('testAction', \Nano\Application\Dispatcher::formatName('test', false));
     $this->assertEquals('anotherTestAction', \Nano\Application\Dispatcher::formatName('another-test', false));
     $this->assertEquals('another_testAction', \Nano\Application\Dispatcher::formatName('another_test', false));
 }