? (Controller_Account - ) :
class Controller_Account extends Controller_Template {
public function action_signin() {...}
public function action_signout() {...}
public function action_signup() {...}
}
As you can see, action names do not have a dash. You cannot use them in method names. But here is to crack it:
public function before()
{
parent::before();
$this->request->action(str_replace('-', '', $this->request->action()));
}
And the route:
Route::set(
'a11n',
'<action>',
array('action' => array('sign-in|sign-up|sign-out'))
)
->defaults(array('controller' => 'account'));
Of course, you can use both signin and sign-in names, just add non-empty names to the Route regular expression parameter:
Route::set(
'a11n',
'<action>',
array('action' => array('sign-in|sign-up|sign-out|signin|signup|signout'))
)
->defaults(array('controller' => 'account'));
source
share