Can't find anything wrong that would relate to
LikecontentSection::beforeSave() not being executed.

A quick debug using XDebug should help you solve this :)



On Sun, Oct 4, 2009 at 4:29 PM, AgBorkowski <[email protected]>wrote:

>
> for eg.
> <?php
> class SectionsController extends LikecontentAppController {
>        public $helpers = array ('Html', 'Form', 'Text');
>        public $uses = array
> ('Likecontent.LikecontentSection','Likecontent.LikecontentContent');
> [...]
> function admin_edit($id = null) {
>                $this->layout = 'admin';
>                if (! $id && empty ( $this->data )) {
>                        $this->Session->setFlash ( __ ( 'Invalid
> LikecontentSection',
> true ) );
>                        $this->redirect ( array ('action' => 'index' ) );
>                }
>                if (!empty ( $this->data )) {
>                        if ($this->LikecontentSection->save ( $this->data ))
> {
>                                $this->Session->setFlash ( __ ( 'The
> LikecontentSection has been
> saved', true ) );
>                                $this->redirect ( array ('admin' => true,
> 'action' => 'index' ) );
>                        } else {
>                                $this->Session->setFlash ( __ ( 'The
> LikecontentSection could not
> be sa
> [....]
> ?>
>
> On 3 Paź, 23:26, Bert Van den Brande <[email protected]> wrote:
> > Can you show some code where the save() is called ?
> >
> > On Sat, Oct 3, 2009 at 7:55 PM, [email protected] <
> >
> > [email protected]> wrote:
> >
> > > save section is ok, but this triger beforeSave don't execute and dont
> > > return any value, only working trigers are in >LikecontentAppModel
> > > whats going one ?
> > > <?php
> > > class LikecontentSection extends LikecontentAppModel {
> > >        public $validate = array(
> > >                'title' => array('notempty'),
> > >                'text' => array('notempty')
> > >        );
> > >        //The Associations below have been created with all possible
> keys,
> > > those that are not needed can be removed
> > >        public $hasMany = array('Likecontent.LikecontentContent');
> >
> > >        public function beforeSave(){
> > >                echo 'dupa';
> > >                exit;
> > >                if(empty($this->data['LikecontentSection']['text']) ||
> > > empty($this-
> > > >data['LikecontentSection']['url']) || $this->data
> > > ['LikecontentSection']['subpage'] == 0){
> > >
>  $this->data['LikecontentSection']['text'] =
> > > '';
> > >                                $this->data['LikecontentSection']['url']
> =
> > > '';
> > >                }
> > >                return true;
> >
>

--~--~---------~--~----~------------~-------~--~----~
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