\Charcoal\View\MustacheAssetsHelpers

Mustache helpers for rendering CSS and JavaScript.

Summary

Methods
Properties
Constants
toArray()
addJs()
js()
addJsRequirement()
jsRequirements()
addCss()
css()
addCssRequirement()
cssRequirements()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$js
$jsRequirements
$css
$cssRequirements
N/A

Properties

$js

$js : string

A string concatenation of inline `<script>` elements.

Type

string

$jsRequirements

$jsRequirements : array

An array of `<script>` elements referencing external scripts.

Type

array

$css

$css : string

A string concatenation of inline `<style>` elements.

Type

string

$cssRequirements

$cssRequirements : array

An array of `<link>` elements referencing external style sheets.

Type

array

Methods

toArray()

toArray() : array

Retrieve the collection of helpers.

Returns

array

addJs()

addJs(string  $js, \Mustache_LambdaHelper  $helper = null) : void

Enqueue (concatenate) inline JavaScript content.

Must include <script> surrounding element.

Parameters

string $js

The JavaScript to add.

\Mustache_LambdaHelper $helper

For rendering strings in the current context.

js()

js() : string

Get the saved inline JavaScript content and purge the store.

Returns

string

addJsRequirement()

addJsRequirement(string  $js, \Mustache_LambdaHelper  $helper = null) : void

Enqueue an external JavaScript file.

Must include <script> surrounding element.

Parameters

string $js

The JavaScript to add.

\Mustache_LambdaHelper $helper

For rendering strings in the current context.

jsRequirements()

jsRequirements() : string

Get the JavaScript requirements and purge the store.

Returns

string

addCss()

addCss(string  $css, \Mustache_LambdaHelper  $helper = null) : void

Enqueue (concatenate) inline CSS content.

Must include <style> surrounding element.

Parameters

string $css

The CSS string to add.

\Mustache_LambdaHelper $helper

For rendering strings in the current context.

css()

css() : string

Get the saved inline CSS content and purge the store.

Returns

string

addCssRequirement()

addCssRequirement(string  $css, \Mustache_LambdaHelper  $helper = null) : void

Enqueue an external CSS file.

Must include <link /> or surrounding <style> element.

Parameters

string $css

The CSS requirements.

\Mustache_LambdaHelper $helper

For rendering strings in the current context.

cssRequirements()

cssRequirements() : string

Get the CSS requirements and purge the store.

Returns

string