On Feb 5, 5:00 am, johnnyice <[EMAIL PROTECTED]> wrote:
> I have a simple route like:
>
> Router::connect('/sync/:action/:id', array('controller' =>
> 'sync_points', 'action' => ''));
>
> And the controller snippet looks like:
>
> function delete($id = null) {
> if (!$id) {
> $this->Session->setFlash(__('Error deleting sync
> point', true));
> $this->redirect(array('action'=>'index'));
> }
> if ($this->SyncPoint->del($id)) {
> $this->Session->setFlash(__('Sync point deleted',
> true));
> $this->redirect(array('action'=>'index'));
> }
> }
>
> QUESTION:
> For some reason when i call "/sync/delete/3"
>
> $id is not populated, but can be found in $this->params['id']
Your route specifies id as a named parameter, if you want it to be the
first parameter the method receives replace :id/ with *
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---