> 1. Cake's reading the id from the url. You're saying, in the url,
> 'show me the Post controller / the View method / and record number
> #n', and Cake's handling that for you automatically.
sure but... what if i comment out all the $id reference?
this cleaned code:
function view() {
$this->set('post', $this->Post->read());
}
continues to work properly; it seems that the $this->Post->id=$id
assignment is not necessary...
> 2. Post/Somefunction only becomes a valid URL if you make a
> corresponding view file for it. You can, if you want, use private
> methods by marking a method with a preceding underscore, so:
>
> _method() { //code }
>
> That'll make the method only accessible to other methods within the
> controller. You can also use routes to redirect users around if they
> try to access a method through the url that they shouldn't be using.
perfect.
thanks...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---