It's pretty clear on the blog tutorial: the action for the controller.
Like:
In General
<?php echo $html->formTag('/controller/action/' .
$html->tagValue('Model/id')?>
In Blog Example:
<?php echo $html->formTag('/posts/edit/' . $html->tagValue('Post/id')?>
And the action in the controller:
function edit($id = null) /* the id variable comes from the form URL you set
above */
{
if (empty($this->data)) /* If there is no data - the first attempt to
access that page */
{
$this->Post->id = $id;
$this->data = $this->Post->read(); /* this will read the post . if
your variable is not $this->data , you MUST use set() to pass to the view */
}
else /* this if some data is being sent by the FORM */
{
if ($this->Post->save($this->data['Post'])) /* will get the
$this->data variable, coming from FORM, and save it to the database, IF it
validates */
{
$this->flash('Your post has been updated.','/posts'); /* will
show a message to the user */
}
}
}
[Section 12]
http://manual.cakephp.org/appendix/blog_tutorial
Spark
On 1/6/07, PHPBABY3 <[EMAIL PROTECTED]> wrote:
I know PHP and am learning CakePHP. I have installed CakePHP and
obtained some files to add to it to produce a search button (meaning a
form that asks questions to implement a searching capability.) In file
default in directory layouts there is a form and the ACTION parameter
is wrong, but when I ask the programmer what the value should be, he
only tells me variables that I don't know the value of. He says to
make it:
http://directory.to.cake/controller_name/control_function
My directory structure is c:\sokkit\site\cake\cake_1.1.12.4205/app/
etc. Directory controllers contains one file, urls_controller.
What do I enter between the quotes in: form action=" . . ." in file
default ?
Thanks
>
--
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br/mp3
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---