$this->params['pass']
Returns an array (with a numerical index) of the URL parameters after the action.
// URL: /posts/view/12/print/narrow Array ( [0] => 12 [1] => print [2] => narrow )
Another method: just pass the parameter to the function itself, as shown below:
function add($id=null) { echo $id; }
this will return your id
source share