I'm having no problem loading the data from the selected table, but it appears the variable where I put it is not bound to the data for the view. When I do $form->input("something_1"); the element is empty. However, in the controller I have verified (using print_r) that the variable is not empty. So, how do I bind that variable so it will be output?

Help!

Merrill Kingston wrote:
If the data I want to put on the page is in an array, just $form->input("thearray")? And, where do I receive the data back when the user hits "submit"? I need to process the users input, before the primary database row for the controller is added/updated and possibly add one or more rows to another table other than the primary table for the controller. I do understand that I need to add the $uses to identify all tables being processed by the controller, if tables other than the primary table are needed. Basically, I've got some business logic I need to apply, before any tables are updated and I'm just having trouble understanding at what point I will get access to the data.

Thanks,

Merrill

Ernesto wrote:
try this

in view

$form->input("something_1");
$form->input("something_2");

in controller action

if (!empty($this->data)) {
     $something_1 = $this->data[$this->modelClass]["something_1"]; //
first field
     $something_2 = $this->data[$this->modelClass]["something_2"]; //
second field
}

On 20 Gen, 00:49, laceja <[email protected]> wrote:
I need to add a few input fields to a view. I'm thinking to create the
variables in the controller and then pass them to the view, but I
don't really understand how to do it. If someone could offer me a
short/simple example, I would appreciate it very much.

Thank you.
------------------------------------------------------------------------

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

--
Merrill Kingston
Phone: 702.798.1806
Fax: 702.522.1455
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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

--
Merrill Kingston
Phone: 702.798.1806
Fax: 702.522.1455

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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