silverstripe-module silverstripe-templatehelpers
Simple template functionality for Silverstripe
heyday/silverstripe-templatehelpers
Simple template functionality for Silverstripe
- Friday, December 8, 2017
- by heyday
- Repository
- 24 Watchers
- 5 Stars
- 2,363 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 2 Forks
- 0 Open issues
- 16 Versions
- 20 % Grown
SilverStripe template helpers
A library with common functionality used by SilverStripe template developers., (*1)
Installation (with composer)
$ composer require heyday/silverstripe-templatehelpers
Usage
Once installed, the following functions are available in any .ss template:, (*2)
-
$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:, (*3)
TemplateHelpers:
dev_images: source/images
prod_images: production/images
dev-master
9999999-dev
Simple template functionality for Silverstripe
Sources
Download
The Requires
2.0.3
2.0.3.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
2.0.2
2.0.2.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
2.0.1
2.0.1.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
dev-ss4-upgrade
dev-ss4-upgrade
Simple template functionality for Silverstripe
Sources
Download
The Requires
2.0.0
2.0.0.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
0.2.x-dev
0.2.9999999.9999999-dev
Simple template functionality for Silverstripe
Sources
Download
The Requires
1.0.3
1.0.3.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
1.0.2
1.0.2.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
1.0.1
1.0.1.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
1.0.0
1.0.0.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
0.1.x-dev
0.1.9999999.9999999-dev
Simple template functionality for Silverstripe
Sources
Download
The Requires
0.0.4
0.0.4.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
0.0.3
0.0.3.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
0.0.2
0.0.2.0
Simple template functionality for Silverstripe
Sources
Download
The Requires
0.0.1
0.0.1.0
Simple template functionality for Silverstripe
Sources
Download
The Requires