Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Error when building database

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 303 Views
  • ranjitendurthi
    Avatar
    Community Member
    2 Posts

    Error when building database Link to this post

    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

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: Error when building database Link to this post

    Hi Ranjit,

    Welcome to the forums,

    I don't see anything wrong with your code, and it builds fine on my testinstall...

    Happy SilverStriping

  • ranjitendurthi
    Avatar
    Community Member
    2 Posts

    Re: Error when building database Link to this post

    Thanks for the reply
    It showed error few times but when I tried to rebuild the database after restarting the server it worked fine

    Thanks anyway

    cheers
    Ranjit

    303 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.