mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Add dd and url helper directives
This commit is contained in:
parent
977a61fb6e
commit
6b2b3f0dc2
2 changed files with 31 additions and 21 deletions
|
|
@ -940,6 +940,16 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
|||
$source = '@dump($foo, Context::get("var"), (object)["foo" => "bar"])';
|
||||
$target = '<?php ob_start(); var_dump($__Context->foo, Context::get("var"), (object)["foo" => "bar"]); $__dump = ob_get_clean(); echo rtrim($__dump); ?>';
|
||||
$this->assertEquals($target, $this->_parse($source));
|
||||
|
||||
// URL
|
||||
$source = "@url(['mid' => 'foo', 'act' => 'dispBoardWrite'])";
|
||||
$target = "<?php echo \$this->config->context === 'JS' ? escape_js(getNotEncodedUrl(['mid' => 'foo', 'act' => 'dispBoardWrite'])) : getUrl(['mid' => 'foo', 'act' => 'dispBoardWrite']); ?>";
|
||||
$this->assertEquals($target, $this->_parse($source));
|
||||
|
||||
// URL old-style with variables
|
||||
$source = "@url('', 'mid', \$mid, 'act', \$act])";
|
||||
$target = "<?php echo \$this->config->context === 'JS' ? escape_js(getNotEncodedUrl('', 'mid', \$__Context->mid, 'act', \$__Context->act])) : getUrl('', 'mid', \$__Context->mid, 'act', \$__Context->act]); ?>";
|
||||
$this->assertEquals($target, $this->_parse($source));
|
||||
}
|
||||
|
||||
public function testComments()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue