Template

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\Template
Since
3.0.0

Class Template

View source (opens new window)

# Public Methods

Method Description
beginProfile() Begins profiling a template element.
css() Registers a CSS file or a CSS code block.
endProfile() Finishes profiling a template element.
js() Registers a JS file or a JS code block.
paginateCriteria() Paginates a query.
paginateQuery() Paginates a query.
raw() Returns a string wrapped in a \Twig\Markup object

# beginProfile()

Since
3.3.0

Begins profiling a template element.

View source (opens new window)

Arguments

# css()

Since
3.5.6

Registers a CSS file or a CSS code block.

View source (opens new window)

Arguments

Throws

# endProfile()

Since
3.3.0

Finishes profiling a template element.

View source (opens new window)

Arguments

# js()

Since
3.5.6

Registers a JS file or a JS code block.

View source (opens new window)

Arguments

Throws

# paginateCriteria()

DEPRECATED

Deprecated in 3.6.0. Use paginateQuery() instead.

Paginates a query.

View source (opens new window)

Arguments

Returns

array (opens new window)

# paginateQuery()

Since
3.6.0

Paginates a query.

View source (opens new window)

Arguments

Returns

array (opens new window)

# raw()

Returns a string wrapped in a \Twig\Markup object

View source (opens new window)

Arguments

Returns

\Twig\Markup

# Constants

Constant Description
PROFILE_STAGE_BEGIN
PROFILE_STAGE_END
PROFILE_TYPE_BLOCK
PROFILE_TYPE_MACRO
PROFILE_TYPE_TEMPLATE