コード例 #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
ファイル: DispatcherTest.php プロジェクト: visor/nano
 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));
 }