Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » DataObjectSet( new DataObjectSet ) in template

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1498 Views
  • karibe
    Avatar
    Community Member
    56 Posts

    DataObjectSet( new DataObjectSet ) in template Link to this post

    Hello
    I have problem with template data access of sub properties.

    I have data structure like this:

    function Calendar()
    {
    $output = new DataObjectSet();

    for ( $week = 1 ; $week <= 5 ; $week++ )
    {
       $output->push( new DataObjectSet() );
    }

    foreach( $output as $objWeek )
    {

    $objWeek->push( new DataObject() );
    $objWeek->push( new DataObject() );
    $objWeek->push( new DataObject() );
    $objWeek->push( new DataObject() );
    $objWeek->push( new DataObject() );

    }

    return $output

    }

    this is simplified example

    in template

    <table>
    <% control Calendar %>
    <tr>

    <% control ??? %>
    here i don't know how to get for example $DayNumber property of each DataObject
    <% control %>

    </tr>
    <% end_control %>
    </table>

    1498 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.