mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Allow use, include, and load directives to appear anywhere in a line
This commit is contained in:
parent
11ef5dcfff
commit
66980edab1
5 changed files with 23 additions and 19 deletions
|
|
@ -1,9 +1,9 @@
|
|||
<config version="2" />
|
||||
|
||||
@use('Rhymix\Framework\Push', 'Push')
|
||||
@include('^/common/tpl/refresh.html')
|
||||
@load('^/common/js/plugins/ckeditor/')
|
||||
@load('css/style.css')
|
||||
<div>@include('^/common/tpl/refresh.html')</div>
|
||||
<div>@load('^/common/js/plugins/ckeditor/')</div>
|
||||
<load src="css/style.css" media="print" />
|
||||
|
||||
<?php
|
||||
$foo = 'FOOFOOFOO';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?php if (!defined("RX_VERSION")) exit(); ?><?php $this->config->version = 2; ?>
|
||||
|
||||
|
||||
<?php (function($__dir, $__path, $__vars = null) { $__tpl = new \Rhymix\Framework\Template($__dir, $__path, "html"); if ($__vars) $__tpl->setVars($__vars); echo $__tpl->compile(); })("common/tpl", 'refresh.html'); ?>
|
||||
<?php \Context::loadJavascriptPlugin('ckeditor'); ?>
|
||||
<?php \Context::loadFile(['./tests/_data/template/css/style.css', '', '', '', []]); ?>
|
||||
<div><?php (function($__dir, $__path, $__vars = null) { $__tpl = new \Rhymix\Framework\Template($__dir, $__path, "html"); if ($__vars) $__tpl->setVars($__vars); echo $__tpl->compile(); })("common/tpl", 'refresh.html'); ?></div>
|
||||
<div><?php \Context::loadJavascriptPlugin('ckeditor'); ?></div>
|
||||
<?php \Context::loadFile(['./tests/_data/template/css/style.css', 'print', '', '', []]); ?>
|
||||
|
||||
<?php
|
||||
$__Context->foo = 'FOOFOOFOO';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
|
||||
<script>
|
||||
<div><script>
|
||||
top.location.reload();
|
||||
</script>
|
||||
</div>
|
||||
<div></div>
|
||||
|
||||
|
||||
{{ $foo }}
|
||||
|
|
|
|||
|
|
@ -1001,7 +1001,7 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
|||
|
||||
$compiled_output = $tmpl->compileDirect('./tests/_data/template', 'v2example.html');
|
||||
$tmpvar = preg_match('/(\$__tmp_[0-9a-f]{14})/', $compiled_output, $m) ? $m[1] : '';
|
||||
Rhymix\Framework\Storage::write(\RX_BASEDIR . 'tests/_data/template/v2result1.php', $compiled_output);
|
||||
//Rhymix\Framework\Storage::write(\RX_BASEDIR . 'tests/_data/template/v2result1.php', $compiled_output);
|
||||
|
||||
$expected = file_get_contents(\RX_BASEDIR . 'tests/_data/template/v2result1.php');
|
||||
$expected = preg_replace('/(\$__tmp_[0-9a-f]{14})/', $tmpvar, $expected);
|
||||
|
|
@ -1010,7 +1010,7 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
|||
$executed_output = $tmpl->compile();
|
||||
$executed_output = preg_replace('/<!--#Template(Start|End):.+?-->\n/', '', $executed_output);
|
||||
$tmpvar = preg_match('/(\$__tmp_[0-9a-f]{14})/', $executed_output, $m) ? $m[1] : '';
|
||||
Rhymix\Framework\Storage::write(\RX_BASEDIR . 'tests/_data/template/v2result2.php', $executed_output);
|
||||
//Rhymix\Framework\Storage::write(\RX_BASEDIR . 'tests/_data/template/v2result2.php', $executed_output);
|
||||
|
||||
$expected = file_get_contents(\RX_BASEDIR . 'tests/_data/template/v2result2.php');
|
||||
$expected = preg_replace('/(\$__tmp_[0-9a-f]{14})/', $tmpvar, $expected);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue