heyday/silverstripe-templatehelpers
最新稳定版本:3.0.0
Composer 安装命令:
composer require heyday/silverstripe-templatehelpers
包简介
Simple template functionality for Silverstripe
关键字:
README 文档
README
A library with common functionality used by SilverStripe template developers.
Installation (with composer)
$ composer require heyday/silverstripe-templatehelpers
Usage
Once installed, the following functions are available in any .ss template:
$isDev- If the site is running in a development environment$isTest- If the site is running in a test environment$isLive- If the site is running in a production environment$ImagePath('my-image.png')- Build an image path based on config for the current environment$addInlineScript('/path/in/theme/directory/file.js')- include a javascript file verbatim in the template (note that<script>tags aren't generated automatically, so you'll need to add those around this call).
$ImagePath config
The image path helper defaults to themes/[theme]/images/. The path within the theme directory can be configured in your project's YAML config:
TemplateHelpers: dev_images: source/images prod_images: production/images
统计信息
- 总下载量: 6.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-07