Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Noob question - syntax error


Go to End


3 Posts   1648 Views

Avatar
Chelios

Community Member, 2 Posts

26 September 2011 at 7:52am

Edited: 26/09/2011 7:54am

Hi Folks,

I am completely new to this and was working my way though the tutorials to get a good grasp of how things fit together.

Completed Tutorial 1 and everything was working just fine. Then started on Tutorial 2 and the following error started occurring once I added the extensions to the Page class.

"Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /var/www/html/mysite/code/ArticlePage.php on line 7"

I tried to search the forum for a solution but the closest matches say to upgrade to PHP 5, unfortunately I am already running PHP 5.3.8.

Thanks in advance for your assistance.

Avatar
Howard

Community Member, 215 Posts

26 September 2011 at 8:53pm

Hey welcome to the forum :)

Sounds as though you have a minor syntax error in your code (on line 7). If you code post the contents of your ArticlePage.php file to a service such as pastie.org then post the link here we will be able to help you out.

Howard

Avatar
Chelios

Community Member, 2 Posts

27 September 2011 at 7:15am

Hi Howard,

Thanks for the welcome :-)

Not sure what it was, I deleted all of the classes that I had added and re-did from scratch ( for the second time ) and now it works. Guess I need to find a tool that does validation and not just syntax highlighting.

Cheers