For instance we will have the following URL:
http://somedomain.com/users/edit/27/
Based on that URL, our controller is users. To access it we will have:
$current_controller = $this->params['controller'];
Our action is edit and we will access it this way:
$current_action = $this->action;
Our first parameter is 27, which is the ID of the record to be edited. We can access it by doing:
$user_id = $this->params['pass'][0];
In case that we have second parameter, we have to access it this way:
$second_parameter = $this->params['pass'][1];
For the third parameter:
$third_parameter = $this->params['pass'][2];
and so on...
You can do these codes either in your controller or view files.
The Code of a Ninja Resources
For FREE programming tutorials, click the red button below and subscribe! :)
website