3060 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1260 Views |
-
Custom Control fail

1 December 2009 at 6:45pm
This may or may not be the best place for this question, so sorry if I'm in the wrong section.
Anyway, I have created a custom page type that has a controller that should pull the submissions from another page's form and display the submissions in a table. However, the function I call from the page controller returns empty strings. Here's my code -- if anyone can shed some light, I'd greatly appreciate it
[in the page type declaration ViewEventsPage.php...]
class ViewEventsPage_Controller extends Page_Controller {
public function EventSubmissionResults() {
$submissions = DataObject::get('EventSubmission');
return new DataObjectSet($submissions);
}
}[and inside the layout ViewEventsPage.ss...]
<% control EventSubmissionResults %>
<tr><td>$Type</td><td>$Details</td></tr>
<% end_control %>Thanks again!
-
Re: Custom Control fail

1 December 2009 at 7:32pm
already returns a DataObjectSet. TryDataObject::get('EventSubmission')
public function EventSubmissionResults() {
return DataObject::get('EventSubmission');
}
| 1260 Views | ||
|
Page:
1
|
Go to Top |


