17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1321 Views |
-
Error 256

23 October 2007 at 10:43pm Last edited: 23 October 2007 11:11pm
Hi guys,
I'm working through Tutorial 2 and have created /tutorial/code/ArticlePage.php with the following code:<?php
/**
* Defines the ArticleHolder page type
*/
class ArticleHolder extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Text'
);static $has_one = array(
);static $allowed_children = array('ArticlePage');
function getCMSFields() {
$fields = parent::getCMSFields();$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
return $fields;
}
}class ArticleHolder_Controller extends Page_Controller {
}
?>
I have run /db/build/?flush=1 and cleared the cache.
The page type now appears in my page type list, however I cannot create a page using it (nothing happens when I click the 'go' button) and I get the following error when trying to go to any other page in the CMS:
ERROR: Error 256 Bad Class to Singleton() - ArticleHolder
Any suggestions as to what I might be doing wrong?
cheers,
nascent -
Re: Error 256

23 October 2007 at 11:51pm
Duh.
There are two pages to create:
ArticlePage.php AND ArticleHolder.phpAll fixed now
n.
| 1321 Views | ||
|
Page:
1
|
Go to Top |

