21492 Posts in 5783 Topics by 2621 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 225 Views |
-
Error when building database

27 October 2011 at 5:06pm
Can anyone tell me the error in the below script
I am getting the error ( ! ) Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\SilverStripe-v2.4.5\SilverStripe-v2.4.5\mysite\code\Fixture.php on line 26 when I build the database
Line 26 is $fields->addFieldToTab( 'Root.Content.Teams', $tablefield );
<?php
class Fixture extends Page {
static $has_one = array(
'MyTeam' => 'Team'
);
function getCMSFields() {
$fields = parent::getCMSFields();$tablefield = new HasOneComplexTableField(
$this,
'MyTeam',
'Team',
array(
'TeamName' => 'TeamName',
'Country' => 'Country',
'Captain' => 'Captain'
),
'getCMSFields_forPopup'
);
$tablefield->setParentClass('Fixture');
$fields->addFieldToTab( 'Root.Content.Teams', $tablefield );
return $fields;
}}
class Project_Controller extends Page_Controller {}Cheers
Ranjit -
Re: Error when building database

28 October 2011 at 7:58am Last edited: 28 October 2011 7:59am
Hi Ranjit,
Welcome to the forums,
I don't see anything wrong with your code, and it builds fine on my testinstall...
Happy SilverStriping
-
Re: Error when building database

28 October 2011 at 10:09am
Thanks for the reply
It showed error few times but when I tried to rebuild the database after restarting the server it worked fineThanks anyway
cheers
Ranjit
| 225 Views | ||
|
Page:
1
|
Go to Top |

