Hi I have got a error in this code.
I don't know what the error is.
But if someone can take a look and see what the error is, and let me know that would be great.
Thanks
<?php
class Services extends Page {
public static $has_many = array(
'Servo' => 'ServicePart'
);
public function getCMSFields() {
$f = parent::getCMSFields();
$config = GridFieldConfig_RecordEditor::create();
//$config = GridFieldConfig_RelationEditor::create();
$servicetext = new GridField("Servo", "Servo", $this->Servo(), $config);
$f->addFieldToTab('Root.Events', $servicetext);
// $f->addFieldToTab('Root.Main', new TextField('Head'), 'Content');
return $f;
}
}
class Services_Controller extends Page_Controller {
public function init() {
parent::init();
}
}
<?php
class ServicePart extends DataObject {
public static $db = array(
'HeadingService' => 'Text',
'DescriptionText' => 'Text'
);
public static $has_one = array(
'Page' => 'Page',
'Image' => 'Image'
);
public function getCMSFields() {
$f = new FieldList();
$f->push( new TextField('HeadingService', 'Heading for service') );
$f->push( new TextField('DescriptionText', 'Description for service') );
return $f;
}
}
?>