nrueckmann / smarty-php

Automatically exported from code.google.com/p/smarty-php
0 stars 0 forks source link

Smarty array in template #178

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Wher i write 

<a href="{Route::get('default')->uri( array( 'lang' => 'en', 
'page_name'=>Request::current()->param('page_name')) )}">ENG</a>
i see error

SmartyCompilerException [ 0 ]: Syntax error in template 
"D:\OpenServer\domains\studio\application\views\layout\base.tpl" on line 33 "<a 
href="{Route::get('default')->uri( array( 'lang' => 'en', 
'page_name'=>Request::current()->param('page_name')) )}">ENG</a>" - Unexpected 
" => ", expected one of: "","" , ")"

if i use php short tags

<a href="{Route::get('default')->uri( [ 'lang' => 'en', 
'page_name'=>Request::current()->param('page_name') ] )}">ENG</a>

all is good
My Smarty version 3.1.17

Original issue reported on code.google.com by WirOAtom@gmail.com on 15 Mar 2014 at 7:29

GoogleCodeExporter commented 8 years ago
Note that Smarty syntax is not PHP. Smarty does use only the [.. , .. , ... ] 
syntax for arrays. By the way since long time before it was introduced in PHP .

So it's no bug.

Original comment by Uwe.Tews@googlemail.com on 15 Mar 2014 at 8:50