Cake uses the following convention in the URLs:

yoursite.com/controller/action/param1/param2/etc...

that is mapped to

Controller::action(param1,param2,etc...)

for more information:

http://manual.cakephp.org/
http://tempdocs.cakephp.org/

HTH,
-Dardo Sordi.

On Jan 31, 2008 8:38 AM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> $article['Article']['id'];
>
> If you add the following line to your view:
>
> <?php pr($article) ?>
>
> You will see the whole structure that is being passed to the view.
>
> On Jan 31, 4:03 am, Salam Fall <[EMAIL PROTECTED]> wrote:
> > I am new to Cake, coming from RubyOn Rails I am traditionally a PHP
> > developer.
> > here is my question :from a turorial I was able to view an article by
> > typingwww.mysite.com/articles/view/1
>
> >                                works great, but how is the id passed
> > to the view action I thought I would have to type
> >
> > www.mysite.com/articles/view/id/1
> >                                  here is the code for my controller
> >                                              controller name
> > articles_controller
> >                                             function view($id = null)
> >                                                      {
> >                                                          $this->Article->id 
> > = $id;
> >                                                          
> > $this->set('article', $this->Article->read());
> >
> >                                                        }
> >
> >                                            my view is named view.thtml
> > and here is the code inside my view
> >                                                       <?php echo
> > $article['Article']['title']; ?>
> >                                                       <br>
> >                                                      <?php echo
> > $article['Article']['body']; ?>
> >
> >                                    Again how does the view action
> > knows and is passed the value of ID .
> >                                         Thanks
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to