php - symfony2 syntax error -
i have following code:
public function postformaction(request $request) { $cityid = $request->request->get('shopioususerbundle_user')['location']['city']; ..... }
for reason giving me syntax error, idea why? when remove array indexing like:
$cityid = $request->request->get('shopioususerbundle_user')
works fine.
array dereferencing result of function call available in php 5.4 or later.
see http://php.net/manual/en/language.types.array.php#example-88
if using earlier php version, have following
$data = $request->request->get('shopioususerbundle_user'); $cityid = $data['location']['city'];
Comments
Post a Comment