Droplet Service - phpManufaktur/kfTemplateTools GitHub Wiki
With Droplets you can execute small php scripts inside any WYSIWYG section. The placeholder for a Droplet can also placed within the HTML parts of your php template script, for example:
<div class="search">
<!-- show the search box -->
[[searchbox?msg='Search this site ...']]
</div>
The Droplet will be executed after the template is completely executed and just before the page will be shown in the browser of the visitor.
To speed up the process a little bit, just execute the Droplet in place and at the same time as the template will be created, use $template['droplet']->execute():
<div class="search">
<?php
$template['droplet']->execute('searchbox', array(
'msg' => 'Search this site ...'));
?>
</div>
Parameters for the Droplet can be attached as array (see above).
You can also execute Droplets within twig templates, use {{ droplet() }}:
<div class="search">
{# show the search box #}
{{ droplet('searchbox', {'msg':'Search this site ...'}) }}
</div>