/** * @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}(); }
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)); }