Hey,
in the model class? Silverstripe is crazy xD
I have the ArtikelHolder.php which looks like:
class ArtikelHolder extends Page
{
//...
static $has_many = array (
'Artikel' => 'Artikel'
);
}
class ArtikelHolder_Controller extends Page_Controller
{
//...
function getEntries ()
{
//...
$ArtikelEntries = singleton('Artikel');
return $ArtikelEntries->getEntryList($array);
}
function templateInclude ()
{
return $this->renderWith($this->template);
}
}
Then I have the ArtikelHolder.ss
<div class="typography">
<h2>$Title</h2>
$Content
<% control getEntries %>
<div class="ArtikelContainer">
$templateInclude
</div>
<% end_control %>
</div>
And the Artikel.php
class Artikel extends DataObject
{
//
function getEntryList($array)
{
// returns DataObjectSet
}
}
After reading your last message, I am very sure that the templateInclude function is wrong in the controller, but what do you mean with the model class?