Hi all,
I am really surprised by Silverstripe CMS. I decided to re-code my actual web. I've gone mad from two cases which I am not able to solve (I am sure there is not serious problem) by my very small knowlage of SS.
Be sure I tried to search the doc first, but - no answer on my questions. I am sure I overlooked somethink...
1. there is custom method on controller which calls method from page object
class FacebookEventPage extends Page {
.....
public function getFbEvent($id) {
$event = DataObject::get_by_id("FacebookEvent", $id);
return $event;
}
..
}
class FacebookEventPage_Controller extends Page_Controller {
...
public function show() {
$id = Controller::curr()->urlParams['ID'];
$this->getFbEvent($id);
return array();
}
And also template placed in FacebookEventPage_show.ss
...
<% control event %>
$event.Begin
<% end_control %>
...
I am not able to get result from DataObject::get_by_id("FacebookEvent", $id); to template ..._show.ss
I am sure that function getFbEvent returns some data.
And second question - how to limit (by condition) resultset when DataObject is initiated. I would tried this in __construct method, but Iam sure how.
Many thanks for response and for really very good work you devs made on SilerStripe framework.