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
typing www.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
-~----------~----~----~----~------~----~------~--~---