-1

$router->addRoutes('', ['controller'=>'Home', 'action'=>'index']);

during compilation its generate an error

Parse error: syntax error, unexpected '['

Please help.

ARNAB
  • 69
  • 1
  • 7

1 Answers1

2

If is not >=5.4

PHP versions <= 5.4 do not support the [] syntax for array construction. Instead you shoud use array():

$router->addRoutes('',array('controller'=>'Home', 'action'=>'index'));
Dan
  • 10,614
  • 5
  • 24
  • 35
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107