$follow keep user_id of follower_id when leader_id upload file I need to find follower_id and send to dashboard of follower and tell leader have upload file if I follow you tell when leader upload I would have value of follower come from?
2011/8/16 <[email protected]>: >> i make sure my code is correct >> but i have no idea how to send $follow to show in dashboard > > > in your dashboard action use loadModel to load in your Follow model and > then you can get access to your $follow array. > > > function script_index($id){ > > $this->loadModel('Follow'); > > $follow = > $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id))); > > } > > http://book.cakephp.org/view/992/loadModel > > > > > >> >> 2011/8/16 <[email protected]>: >>>> I try to create notification system >>>> >>>> function add_script() { >>>> >>>> if (!empty($this->data)) { >>>> $this->Script->create(); >>>> $this->Ring->bindUp(); >>>> $this->data['Script']['script_catagories_id'] = >>>> $this->data['Script']['scriptCatagories']; >>>> $this->data['Script']['user_id'] = $this->Auth->user('id'); >>>> if ($this->Script->save($this->data)) { >>>> $id = $this->Auth->user('id'); >>>> $follow = >>>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id))); >>>> $this->Session->setFlash(__('The script has been >>>> saved', >>>> true)); >>>> $this->redirect(array('action' => 'script_index')); >>>> } else { >>>> $this->Session->setFlash(__('The script could not be >>>> saved. Please, try again.', true)); >>>> } >>>> } >>>> >>>> when data save check follows table if have leader_id read data and >>>> send to dashboard controller >>>> I don,t know how to send data controller to other controller if >>>> possible please guide me >>> >>> i'd do the following >>> >>> >>>> $this->redirect(array('action' => >>>> 'script_index',$id)); >>> >>> and in your script_index action, add the find >>> >>> $follow = >>> $this->Follow->find('all',array('conditions'=>array('leader_id'=>$id))); >>> >>> make sure your models are related or use a loadModel to get access to >>> the >>> follow model. >>> >>> >>>> >>>> best regard >>>> taqman >>>> >>>> -- >>>> Our newest site for the community: CakePHP Video Tutorials >>>> http://tv.cakephp.org >>>> Check out the new CakePHP Questions site http://ask.cakephp.org and >>>> help >>>> others with their CakePHP related questions. >>>> >>>> >>>> To unsubscribe from this group, send email to >>>> [email protected] For more options, visit this >>>> group >>>> at http://groups.google.com/group/cake-php >>>> >>>> >>> >>> >>> -- >>> Our newest site for the community: CakePHP Video Tutorials >>> http://tv.cakephp.org >>> Check out the new CakePHP Questions site http://ask.cakephp.org and help >>> others with their CakePHP related questions. >>> >>> >>> To unsubscribe from this group, send email to >>> [email protected] For more options, visit this group >>> at http://groups.google.com/group/cake-php >>> >> >> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions. >> >> >> To unsubscribe from this group, send email to >> [email protected] For more options, visit this group >> at http://groups.google.com/group/cake-php >> >> > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
