Im creating new SilverStripe project based on the tutorial of SilverStripe.
After adding this code, the CMS field dont show and gives error.
class ArticlePage extends Page {
private static $db = array(
'Date' => 'Date',
'Author' => 'Text',
);
// .....
public function getCMSFields() {
$fields = parent::getCMSFields();
$dateField = new DateField('Date', 'Article Date (for example: 20/12/2010)');
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd/MM/YYYY');
$fields->addFieldToTab('Root.Main', $dateField, 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Author', 'Author Name'), 'Content');
return $fields;
}
}
the error is:
Fatal error: Class 'DateField' not found in sample/sample/ line*
I don't see any problem with the code as I copy it from the tutorial itself. please help
composer showin your terminal? - scrowler