I suppose you tried debugging your variable, but if you get undefined 
index, you should check if this array actually contains some data. 
Debugging inside controller, and debugging $this->data is a good way to 
find out what is going on...
If you still have problems, please provide more info and code so we can see 
where is the problem :-)

cheers

Dana utorak, 14. kolovoza 2012. 16:12:43 UTC+2, korisnik mohit napisao je:
>
> I tried that also using a for each. still having some problems with it.
>
> *With Best Regards,
> Mohit Kumar <http://kumarmohit.com>*
> *+91-9582894570*
>
>
>
> On Tue, Aug 14, 2012 at 7:39 PM, Dave M. <[email protected] 
> <javascript:>>wrote:
>
>> I suggest you throw a debug($weeklyroster) into your view to see how the 
>> array is actually structured. I would assume that you would want 
>> $weeklyroster[0]['Weeklyroster']**
>> ['week'], $weeklyroster[1]['Weeklyroster']**['week'], etc.
>>
>> On Monday, August 13, 2012 11:39:37 AM UTC-4, mohit wrote:
>>>
>>> Hi Folks,
>>>
>>> I am having a strange error. I don't know what I am doing wrong.
>>> I am using following code in my weeklyrostercontroller.php file
>>>
>>>     var $uses = array('Weeklyroster','Shift');
>>>>
>>>
>>> I have created a function to generate the roster.
>>>
>>>
>>>     public function generate($id = null) {
>>>>         $this->Weeklyroster->week= $id;
>>>>         //if (!$this->Weeklyroster->exists(**)) {
>>>>     //throw new NotFoundException(__('Invalid weeklyroster'));
>>>>     //    }
>>>>         //$this->set('weeklyroster', $this->Weeklyroster->read('**week', 
>>>> $id));
>>>>         $current_roster = $this->Weeklyroster->find('**all', 
>>>> array('conditions' => array('Weeklyroster.week' => $id)));
>>>>         foreach ($current_roster as $current_rosters) {
>>>>             $vid=$current_rosters['**Weeklyroster']['id'];
>>>>             
>>>>             $current_shifts = 
>>>> $this->Weeklyroster->Shift->**find('all',array('conditions' 
>>>> => array('Shift.id' => $vid)));
>>>>             
>>>>             
>>>>         }
>>>>         
>>>>         
>>>>         $this->set('weeklyroster', $current_roster);    
>>>>         $this->set('current_shifts',$**current_shifts);
>>>>             
>>>>     }    
>>>> }
>>>
>>>
>>>   if a use following code ($weeklyroster['Weeklyroster']**['week'] in 
>>> my view file , I get the following error.
>>>
>>> *Notice* (8): Undefined index: Weeklyroster 
>>> [*APP\View\Weeklyrosters\generate.ctp*, line *3*]
>>>
>>> Please suggest
>>>
>>>  
>>>
>>> *With Best Regards,
>>> Mohit Kumar <http://kumarmohit.com>*
>>> *+91-9582894570*
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>>  
>>  
>>
>
>

-- 
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].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.


Reply via email to