I have page:
ProjectsAndServicesPage.php
RecentProjectObject.php
RecentProjectImagesObject.php
ProjectsAndServicesPage.ss
ProjectsAndServicesPage.php
class ProjectsAndServicesPage extends Page {
static $db = array(
);
static $has_one = array(
'ImageListProjects' => 'Image',
);
static $has_many = array(
'RecentProjectObject' => 'RecentProjectObject'
);
}
RecentProjectObject.php
class RecentProjectObject extends DataObject{
static $db = array(
);
static $has_one = array(
'ProjectsAndServicesPage'=>'ProjectsAndServicesPage'
);
static $has_many = array(
'RecentProjectImagesObject'=>'RecentProjectImagesObject'
);
}
RecentProjectImagesObject.php
class RecentProjectImagesObject extends DataObject {
static $db = array(
);
static $has_one = array(
'ImageRecentObject' => 'Image',
'RecentProjectObject' => 'RecentProjectObject',
);
}
ProjectsAndServicesPage.ss
<% control RecentProjectObject %>
<li<% if Last %>class="last"<% end_if %>>
<h3>$TitleProject</h3>
<p class="welcome">$WelcomeProject</p>
<ul class="clearfix">
<% control getRecentProjectImagesObjects %>
<li<% if Last %>class="last"<% end_if %>><a href="">$ImageRecentObject.CroppedImage(198,148)</a></li>
<% end_control %>
</ul>
<p><span>$Designer</span>$ContentDesigner</p>
<p><span>$ProjectManagement </span> $ContentProjectManagement</p>
<p><span>$ProjectManager </span>$ContentProjectManager </p>
<p><span>$Completed</span>$ContentCompleted</p>
</li>
<% end_control %>
ProjectsAndServicesPage.php
class ProjectsAndServicesPage_Controller extends Page_Controller {
function getRecentProjectImagesObjects($limit = 3) {
$url = $this->request->param('ID');
return DataObject::get("RecentProjectImagesObject", "RecentProjectObjectID='$url'", "ID Asc", "", $limit);
}
}
I write <% control getRecentProjectImagesObjects %>. This doesn't work. Please Help