I have been experimenting in CakePHP with links and noticed that sometimes you just pass parameters and sometimes pass them with names prefixed. What is the difference between the two links:
$this->Html->link('Edit', array('controller'=>'users','action'=>'edit', $user['User']['id']));
$this->Html->link('Edit', array('controller'=>'users','action'=>'edit', 'id'=> $user['User']['id']));
The URL they create is largely irrelevant due to the routing capabilities, but in the first example I access the id directly in the controller method like:
public function edit( $id )
but for the named parameter I would have to physically pass it using the router!
Can anyone shed some more light on this? What the difference is and when to use each...
Also worth noting is that in CakePHP 3.0, they have removed named parameters which seems odd because BOTH links would still work... Any thoughts on this?