imponeer / smarty-includeq
重写的smarty 'include'变体,最初是为了在XOOPS中使用而发明,但现在也用于一些其他基于PHP的CMS中
v2.0.2
2023-07-01 16:32 UTC
Requires
- php: ^7.3 || ^8.0
- imponeer/smarty-extensions-contracts: ^3.0
Requires (Dev)
- phpunit/phpunit: ^8.0 || ^9.0
README
Smarty IncludeQ
由于原始使用GPLv2+许可证,重新编写的Smarty 'include'变体,最初是为了在XOOPS中使用而发明,但现在在有些其他基于PHP的CMS(如ImpressCMS)中也使用。
查看,Xoops中此smarty插件的原始版本,以了解更多关于此插件存在的原因的描述。
安装
要安装和使用此包,我们建议使用Composer
composer require imponeer/smarty-includeq
否则,您需要手动包含来自src/
目录的文件。
在Smarty中注册
如果您想从该项目使用此包中的扩展,您需要使用registerPlugin
函数从Smarty中进行注册。例如
$smarty = new \Smarty(); $includeqPlugin = new \Imponeer\Smarty\Extensions\IncludeQ\IncludeQCompiler(); $smarty->registerPlugin('compiler', $includeqPlugin->getName(), [$includeqPlugin, 'execute']);
从模板中使用
如何使用的示例
{includeq file="file.tpl"}
如何贡献?
如果您想添加一些功能或修复错误,您可以对代码进行分支、修改并创建pull request。如果您不确定如何操作,请尝试交互式GitHub教程。
如果您发现任何错误或有一些问题,请使用问题选项卡并在其中写下您的问题。