smtech/stmarkssmarty

此包已被废弃且不再维护。没有推荐替代包。

St. Mark's项目标准Smarty安装

v1.0.1 2017-05-24 17:44 UTC

This package is auto-updated.

Last update: 2023-05-25 12:48:25 UTC


README

Latest Version Scrutinizer Code Quality

Smarty包装器,为我们的脚本和应用程序提供一致的UI。

安装

因为此包使用了Bower管理的客户端文件以及Composer管理的后端文件,所以在尝试使用此包之前运行以下命令是非常有帮助的

composer global require "fxp/composer-asset-plugin:^1.1"

了解更多关于 fxp/composer-asset-pluginBower 的信息。

然后,在 composer.json 中包含以下内容

"require": {
  "smtech/stmarkssmarty": "dev-master"
}

使用

如果您没有自己的模板

$smarty = StMarksSmarty::getSmarty();

// ...app logic...

$smarty->assign('content', '<p>whatever content you want displayed</p>');
$smarty->display();

如果您有自己的模板目录

$smarty->addTemplateDir('<path-to-your-templates-dir>');

如果您的应用程序将作为嵌套的 iframe 展示

$smarty = StMarksSmarty::getSmarty(true);

完整的 API文档 包含在仓库中,并且 Smarty API文档 也在线上。