Sunday, October 31, 2010

Re: need help with form

Does that mean that I can have a view that does not have a
corresponding action?

How would i get the form to use person and the values from the input?

Sorry for the newb questions...

On Oct 31, 8:19 pm, cricket <zijn.digi...@gmail.com> wrote:
> On Sun, Oct 31, 2010 at 5:48 PM, Briko03 <nathanrlar...@gmail.com> wrote:
> > Here is my view:
>
> > <?php
> > echo $form->create('Result', array('action' => 'findperson'));
> > echo $form->input('lname');
> > echo $form->input('fname');
>
> > echo $form->submit();
> > echo $form->end();
> > ?>
>
> > Here is the action:
>
> > function findperson()
> >           {
> >                if (!empty($this->data)) {
> >                        $this->redirect(array('action' => 'person'));
> >                        }
> >                }
> >        //I want to append this to the redirect - $this->data['Result']
> > ['lname']
>
> > I am kind of stuck at the moment and not sure what I am doing
> > wrong....
>
> Don't redirect as that creates an entirely new request. You could use
> setAction() instead.
>
> But I think you need to ask yourself whether this is really the best
> way to do this. findPerson() doesn't seem to do a lot of finding at
> all. So why bother? Couldn't you simply go directly to person()?
>
> > Right now when i click submit i just get a blank white screen.
>
> Probably a fatal error. Set debug to 2 and/or check your server log.

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

No comments: