Docs »

Plugins »

Templates

Cerb plugins use the Smarty template engine.

Templates are stored in the plugin’s templates/ directory.

They are referenced from plugin code like:



$tpl = DevblocksPlatform::services()->template();
$tpl->assign('name', 'Kina Halpue');
$tpl->display('devblocks:example.plugin::path/to/template.tpl');


In ->display(), example.plugin should be your plugin’s ID. The path/to/ is relative to the plugin’s templates/ directory.

Here’s an example template:



<div>
	Hello, <b>{$name}</b>!
</div>