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