views:

357

answers:

1

I have log in functionality that will check for a session, if it not there the user will be redirected via Request::instance()->redirect('managers/error/1');

In the error action in the managers controller I can't get the value 1 which represents a specific error msg. How can I capture the value "1" from the url, I'm only using standard routes.

+3  A: 

Depending on your route, you could do

public function action_error($id) {
   // $id will be your 1
}

Or you could set up a route explicitly

Route::set('managers_errors', 'managers/error/<id>',  array('id' => '\d+'));

Then you could use in the method / action

$id = $this->request->param('id');
alex
Alex, thank you!
pigfox