[TYPO3-mvc] JSON - based View

Dennis Ahrens dennis.ahrens at googlemail.com
Thu May 10 15:29:04 CEST 2012


Hi Frank,

On 10.05.2012 15:10, Frank Gerards wrote:
> ...->setConfiguration(
>                Array(
>                   'data' =>  array(
>                      'locations' =>  array(
>                           '_descendAll' =>  array()
>                      )
>                   )
>               )
>        )
>
> What is rendered are all ObjektA array-entries , but NOT the ObjektB entries.
>
> What would be the right syntax for the configuration to render the complete structure down to ObjektB with the ext_js_json_view ?

Objects are not included by default (DateTime, too), you need to tell 
this for each subobject in addition.

...->setConfiguration(
                 Array(
                    'data' =>  array(
                       'locations' =>  array(
                            '_descendAll' =>  array(
			      'bereich' => array(
				 '_descendAll' => array()
			      )
			   )
                       )
                    )
                )
         )

If there are objects inside 'bereich' you need to specify them, too.

I usually write a static method e.g. in a corresponding controller, that 
defines what has to be rendered for a specfic object. Those methods call 
each other in the case of aggregates.

This way you have a configuration for each object and can combine them 
depending on your purpose.

regards
Dennis


More information about the TYPO3-project-typo3v4mvc mailing list