Dwoo has a rich plugin system. Plugins can be wrapped in classes or simple functions, pre-compiled for performance, and shared across projects.
Built-in Plugins
{escape}
Escape output for HTML, JS, URL, and more.
{upper}
Convert string to uppercase.
{lower}
Convert string to lowercase.
{nl2br}
Insert HTML line breaks before newlines.
{cat}
Concatenate strings.
{include}
Include another template file.
{math}
Perform math operations in templates.
{date_format}
Format a date value.
{truncate}
Truncate a string to a specified length.
{strip_tags}
Strip HTML tags from a string.
{count}
Count the number of items in a variable.
{default}
Use a default value if variable is empty.
Community Plugins
Kohana Adapter
A Dwoo integration module for the Kohana PHP framework, including a demo controller and configurable cache paths.
View details →Writing Custom Plugins
You can write your own plugins as a simple function or a class:
// Function plugin
function Dwoo_Plugin_hello(Dwoo\Core $dwoo, $name) {
return 'Hello, ' . htmlspecialchars($name) . '!';
}
// Use in template:
// {hello name="World"}
See the documentation for the full plugin API reference.