Re: Named parameters, forms and redirects
Thanks for the reply, I seem to have found a way to make this work, by
only checking for the parameter if $data is empty, as otherwise the id
is kept in the data array.
But still not sure if I'm doing things right.
To answer your points below
1.This bit of code is the only part which is doing anything related to
accepting the parameter, the passedArgs seems to be automatically
filled in.
if(isset($this->passedArgs['foreign_id']))
$this->data['model']['foreign_id'] = $this-
>passedArgs['foreign_id'];
2. I do not explicitly pass it to the view, the above code puts the
parameter into the data variable.
3.The form is generated by the form helper, this line is used for the
forigen key, the value gets automaically filled in when I have
assigned it to the data variable,
echo $this->Form->input('foreign_id',array( 'type' => 'hidden'));
Thanks
On Nov 4, 1:45 pm, WebbedIT <p...@webbedit.co.uk> wrote:
> Hi,
>
> Need to post the relevant parts of your controller and view so that we
> can see how you are
>
> 1. accepting the variable into your controller method
> 2. passing it to your view
> 3. including it in the form to pass it back to the controller.
>
> HTH, Paul
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home