Dipak Baravkar
Dipak Baravkar

Reputation: 21

syntax error, unexpected '$config' (T_VARIABLE) in Silverstripe

I have create a class GalleryImage In SilverStripe.In that I am creating a config object for the grid field, but it gives error syntax error, unexpected '$config' (T_VARIABLE). How to solve this ?

    $config = GridFieldConfig::create(); 

Upvotes: 1

Views: 2910

Answers (1)

ADW
ADW

Reputation: 4080

Chances are the problem is on the line (or lines) before. For example this:

$myvar=1;
$config = GridFieldConfig::create();

won't cause a syntax error (of the type you're seeing here) but:

$myvar=1
$config = GridFieldConfig::create();

(note the missing semi-colon) will cause an error like you are getting.

It may not be a missing semi-colon, but check the line before the one giving you the error.

Upvotes: 3

Related Questions