Jump to content

Recommended Posts

Posted

I am just creating my very first template files and have been unable to resolve the following problem. It says the '=' sign is unexpected but I have other templates files where identical code works OK. Is there something I'm missing? I have just included the 2 lines of code involved. Any help would be appreciated.

Line 64         $ground-equipment = $page->children();                             
Line 65         foreach($ground-equipment as $ground) 

Parse error: syntax error, unexpected '=' in /volume1/web/Testing-Ryan/site/templates/GroundEquipment_Display_Page.php on line 64

Posted

PHP doesn't let you use dashes/hyphens in variable names.

Either $ground_equipment or $groundEquipment will work.

 

  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...