1 - The "$this->Post->id = " tells what ID to use for read(). If no ID
is passed then it wont find the correct data or it will return the
first row in the database.

2 - Every page (or action, e.g., /users/login, login is the page) must
be created within the respective controller.

3 - $this->data is the $_POST, or the data you passed to it. If you
used the form helper, the fields should auto-populate if $this->data
has values.

On Sep 18, 11:45 am, Simon <[email protected]> wrote:
> nobody helps no body here sometimes you get luck we need a group
> called cakephp_for_noobs
>
> On Sep 18, 11:40 am, lorenx <[email protected]> wrote:
>
> > a little help please?
>
> > On Sep 17, 8:05 pm, lorenx <[email protected]> wrote:
>
> > > hi all,
> > > i'm new to cakephp and, mentioning the blog tutorial, i have some
> > > simple questions.
>
> > > 1.
> > > in the sample controller, there is the view action:
>
> > > function view($id = null) {
> > >         $this->Post->id = $id;
> > >         $this->set('post', $this->Post->read());
>
> > > }
>
> > > to better understand, i did some tests.
> > > i tried to comment out the passed parameter $id and the 
> > > $this->Post->id=$id assignment... and the code seems to work as before.
>
> > > i also printed_r the Post object, before and after that line, but no
> > > change appeared.
> > > so... what exactly do the assignment? and passing the $_GET parameter
> > > is necessary?
>
> > > 2.
> > > does every function in the controller involve the creation of a
> > > method, of an action?
>
> > > 3.
> > > in the edit action, there is the $this->data variable.
> > > i presume that this variable is going to populate the edit form. how
> > > is this handled?
>
> > > thanks to all!- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to