mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Also support $foo->$bar syntax in cond="" and loop="" syntax
This commit is contained in:
parent
2a026a6c86
commit
606989c451
2 changed files with 39 additions and 4 deletions
|
|
@ -324,6 +324,14 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
|
|||
array(
|
||||
'<!--@if($foo->$bar)--><div></div><!--@endif-->',
|
||||
"\n" . 'if($__Context->foo->{$__Context->bar}){ ?><div></div><?php } ?>'
|
||||
),
|
||||
array(
|
||||
'<aside cond="$foo->$bar"><img src="" /></aside>',
|
||||
"\n" . 'if($__Context->foo->{$__Context->bar}){ ?><aside><img src="" /></aside><?php } ?>'
|
||||
),
|
||||
array(
|
||||
'<ul loop="$foo->$bar => $key, $val" class="test"|cond="$foo->$key"><li>{$val}</li></ul>',
|
||||
"\n" . '$__loop_tmp=$__Context->foo->{$__Context->bar};if($__loop_tmp)foreach($__loop_tmp as $__Context->key=>$__Context->val){ ?><ul<?php if($__Context->foo->{$__Context->key}){ ?> class="test"<?php } ?>><li><?php echo $__Context->val ?></li></ul><?php } ?>'
|
||||
),
|
||||
// Rhymix autoescape
|
||||
array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue