Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Error 256


Reply


3 Posts   1443 Views

Avatar
nascent

6 Posts

23 October 2007 at 10:43pm

Edited: 23/10/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

Avatar
nascent

6 Posts

23 October 2007 at 11:13pm

Here's the full error message.

Avatar
nascent

6 Posts

23 October 2007 at 11:51pm

Duh.
There are two pages to create:
ArticlePage.php AND ArticleHolder.php

All fixed now
n.