script

Wednesday, June 20, 2012

Use array of objects in fluid + extbase

Assign object that can be used in fluid template

Controller
$uploads is object of controller
By $uploads->div[] asigining each value to object upload


        $divs = array(1,2,3,4,5);
        foreach($divs as $d)
        {
            $uploads->div[] = $d;
           
        }


Now use in fluid template

<f:for each="{uploads}" as="upload">
        <f:cycle values="{uploads.div}" as="cycle">
       {cycle}
       </f:cycle>
</f:for>


Output:
It will print 12345

No comments:

Post a Comment