You did not specify the version of the cake you are using. please always do this. not to mention this, you will get a lot of false answers, because a lot changes during versions.
if you are using the latest 2.3.0, for example, you can use the recently added query method:
$id = $this->request->query('id');
in your controller. http://book.cakephp.org/2.0/en/controllers/request-response.html#CakeRequest::query
but old ways also work:
$id = $this->request->params->url['id']; // property access $id = $this->request->params[url]['id']; // array access
you cannot use named with
$id = $this->request->params['named']['id'] // WRONG
your url will need to be www.example.com/tester/retrieve_test/good/id:012345 . therefore havelock answer is incorrect
then pass your identifier to the default form - or in your case directly to the save statement after the submitted form (there is no need to use the hidden field here).
$this->request->data['Listing']['vt_tour'] = $id; //save
if you really need / want to submit it to the form, use the else $this->request->is(post) block:
if ($this->request->is(post)) { //validate and save here } else { $this->request->data['Listing']['vt_tour'] = $id; }
source share