Thursday, October 1, 2009

Re: Modyfication into beforeSave()

I have any rules for validation, the output by invalidFields() is
empty...

Any solutions?
How add next $this->data['Tag'][3 and 4 and 5...]['name'] in beforeSave
()?

On Sep 29, 2:35 am, Marcelo Andrade <mfandr...@gmail.com> wrote:
> On Mon, Sep 28, 2009 at 6:03 PM, kicaj <ki...@kdev.pl> wrote:
>
> > I have relations Post hasMany Tag, and my form look like this:
>
> > <?php       echo $form->create('Post');
> >                echo $form->input('name');
> >                echo $form->input('content');
> >                echo $form->input('Tag.0.name');
> >                echo $form->input('Tag.1.name');
> >                echo $form->end('Submit');       ?>
>
> > ...and this form create 3 INSERT queries ($this->Post->saveAll()),
> > but I would like adding some fields in beforeSave() function, for
> > example:
> > $this->data['Tag'][2]['name'] = 'some...';
> > $this->data['Tag'][3]['name'] = 'some2...';
>
> > But this's not working, why?
> > How I can adding fields into beforeSave
>
> Do you have any validation rules?  What's the
> output from $this->Post->invalidFields() after
> save all?
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
--~--~---------~--~----~------------~-------~--~----~
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: