Why would do you that when you can make the JsonView take care of that:
$this->set(array(
'people' => $people,
'_serialize' => array('people')
));
On Sunday, July 29, 2012 9:41:24 PM UTC+2, Walter Raponi wrote:
>
> $this->set(array(
> 'people' => $people,
> '_serialize' => array('person')
> ));
>
> Do we need serialize??
>
> Just try $this->set('person', $people);
>
> And in view
> Echo json_encode($person);
>
>
>
> =============================
> *Walter Raponi*
> Din S.r.l.
> Via Donato Menichella 304
> 00156 Roma - Italy
>
> Tel 0641227662
> Fax 0641227664
> [email protected]
>
> Il giorno 29/lug/2012, alle ore 19:01, "Mariano C." <
> [email protected]> ha scritto:
>
> Yes I've read that message, but I don't understand what it means. Why I
> get that error only in json and xml output and not in a normal view?
>
>
> Il giorno domenica 29 luglio 2012 18:35:37 UTC+2, rchavik ha scritto:
>>
>>
>>
>> On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:
>>>
>>> Nothing change, I got the same error. :(
>>>
>>>
>> Read the error message:
>>
>> <b>Notice</b> (8)</a>: Undefined index: person
>> [<b>CORE\Cake\View\JsonView.php</b>, line <b>89</b>
>>
> --
> 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