wscore / template
该软件包最新版本(0.1.0)没有提供许可证信息。
仅使用PHP的一个简单模板引擎。
0.1.0
2013-08-23 11:37 UTC
Requires
- michelf/php-markdown: 1.3
This package is auto-updated.
Last update: 2024-08-28 17:02:24 UTC
README
仅使用PHP的一个简单模板引擎。
- 没有解析。
- 多重继承,类似于Twig。
- 块,有点像。
- 自动输出编码和过滤器。
多重继承
layout.php
Layout:<?php echo $_v->get( 'content' ); ?>
同时你还有example.php
<?php $_v->parent( __DIR__ . '/layout.php' ); ?> test:<?php echo $_v->test;?>
然后你运行
$content = $t->render( 'sample.php', array( 'test' => 'This is a sample.' ) );
然后你会得到
Layout:test:This is a sample.
待办事项
必须考虑如何轻松管理大量过滤器。