17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1052 Views |
-
Use of DataObject::

7 March 2008 at 2:29pm
O.K, newbie question.
I have put the following code into a Page called NewPage.php:
class NewPage extends Page {
static $db = array(
);static $has_one = array(
);}
class NewPage_Controller extends Page_Controller {
function newFunction1() {
return DataObject::get("Page", "ParentID=0");
}}
In NewPage.ss I call newFunction1 by using:
<% control newFunction1 %>
<li><a href="$Link" title="Go to the $Title.XML page"><span>$MenuTitle.XML</span></a></li>
<% end_control %>
When I then access the page, I get the following error:
ERROR:
Error
The website server has not been able to respond to your request.What have I missed?
-
Re: Use of DataObject::

7 March 2008 at 9:20pm
well first - open _config.php and add Director::set_environment_type("dev"); so you can see a more useful error apart from the blank error page!
-
Re: Use of DataObject::

10 March 2008 at 11:53am
Thanks, the extra debugging info is very helpful. I rebuilt the page it works fine. I think I had a typo....
| 1052 Views | ||
|
Page:
1
|
Go to Top |


