Experts:
I am certain this has been discussed before, but I can not find it here. I am just getting started with SS
and so far Tutorial 1 has been great. Now I get to #2 and things become fuzzy.
Running on a site on GoDaddy, so all is pre-installed.
It is not very clear as to where to place the function getCMSFields in the ArticlePage.php code.
I have placed it like this:
<?php
/**
* Defines the ArticlePage page type
*/
class ArticlePage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Text'
);
static $has_one = array(
);
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 ArticlePage_Controller extends Page_Controller {
}
After which I flush and rebuild the db
http://xxx.com/silverstripe/db/build?flush=1
After which in the rebuild output I see:
Parse error: syntax error, unexpected T_CLASS, expecting T_FUNCTION
Can one of you experts on SS direct me in the right direction please?
Trying to come up to speed with this and it seems to be a battle to undertand
how this works in comparison to the build the code by hand method.
Thanks so much!
DB_steve