mcustiel/inlineassets-plugin

此包已 废弃,不再维护。未建议替代包。
此包的最新版本(v1.0.1)没有可用的许可证信息。

提供内联样式和内联脚本,将资源嵌入HTML中

安装: 709

依赖项: 0

建议者: 0

安全: 0

星标: 2

关注者: 2

分支: 0

开放问题: 0

类型:october-plugin

v1.0.1 2016-10-07 12:37 UTC

This package is auto-updated.

Last update: 2023-07-19 06:32:40 UTC


README

OctoberCMS插件,提供将资源嵌入页面的功能。

Twig标签

内联样式

将添加的CSS文件内容嵌入到HTML代码中。

示例

  • Component.php
$this->addCss('my/style.css');
  • my/style.css
a {
    color: red;
}
  • twig.htm
<head>
    {% inlineStyles %}
</head>
  • HTML结果
<head>
    <style type="text/css">
    a {
        color: red;
    }
    </style>
</head>

内联脚本

此标签的行为类似于内联样式,用于添加通过addJs添加的JavaScript资源。