php-liquid icon indicating copy to clipboard operation
php-liquid copied to clipboard

tag names with dots is removed

Open 99kennetn opened this issue 3 years ago • 2 comments

If i the following scenario, which is used often in the project i work with. $template = new Template; $template->parse("Hello, {{ name.1 }}!") $template->render(array('name.1'=> 'Kennet')) it will output "Hello, !" so if the array key has a . in it it does not replace the tag correctly

If i remove the . from both the parse and render function call, it works as expected, but as 'name.1' is a valid name for a php array key, i think it should work the same. Or have i missed something? :)

99kennetn avatar Aug 22 '22 12:08 99kennetn

It seems that if i change the array to be build like this array('name' => ['1' =>'Kennet']) it works as expected, but i still think the other scenario should be possible. :)

99kennetn avatar Aug 22 '22 12:08 99kennetn

@99kennetn only the array notation is possible in the original Ruby implementation, probably best to not introduce non-standard patterns here

schmoove avatar Feb 08 '24 09:02 schmoove