Re: Form data from a view element

2008-09-18 Thread Daniel
Just to add more information: It seems that beforeFilter() is called in my comments controller but something goes wrong before afterFilter() is called... I'm trying to spelunk my way through the cakePHP code to see if I can find a reason for this - Dan On Sep 18, 11:39 am, Daniel <[EMAIL P

Re: Form data from a view element

2008-09-18 Thread Daniel
Hi Luenyar, I changed the form create line to: create('Comment', array('action' => 'add', 'url' => array('controller' => 'comments', 'action' => 'add'))); ?> And when I submit the element form it _does_ send me to the right url, that is /comments/add which is the right controller, but i

Re: Form data from a view element

2008-09-17 Thread Luenyar
$form->create('Comment') associates the form with the 'Comment' model, but not a controller. Presumably because the 'Comments' model could be used in many or all of your controllers with $uses. The 'action' option assumes the current controller, so if you render your element in the Posts control

Re: Form data from a view element

2008-09-16 Thread Daniel
I created the form using the line: $form->create('Comment', array('action' => 'add')); Doesn't this specify that it should use the controller associated with the "Comment" model, i.e. the Comments controller? This is how I've done it with all of my other forms... And yes, I realize the table ba

Re: Form data from a view element

2008-09-16 Thread mark_story
On Sep 16, 9:11 am, Daniel <[EMAIL PROTECTED]> wrote: > Hello, > > I currently have a "comment box" view element that I plan to > embed in various places in my CakePHP application to allow users to > leave comments on various aspects of the site. > > I'm using the form helper inside of t

Re: Form data from a view element

2008-09-16 Thread David C. Zentgraf
It doesn't matter whether your form comes from an element or a view file, it's generating the same HTML in the end, so check that first. If the form/controller doesn't work it's not a problem of the element. I'd guess that one of your problems is that you want to redirect as the final action

Form data from a view element

2008-09-16 Thread Daniel
Hello, I currently have a "comment box" view element that I plan to embed in various places in my CakePHP application to allow users to leave comments on various aspects of the site. I'm using the form helper inside of the element to generate the form to be used to submit the data, how