Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

DataObjectSet( new DataObjectSet ) in template


Go to End


1836 Views

Avatar
karibe

Community Member, 56 Posts

7 October 2007 at 4:17am

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>