Plugins - Leopard-Coding/Leopard-Template-Engine GitHub Wiki

Plugins can be saved inside the plugins folder. These have to be PHP files, which are registered in the configuration.

Example Plugin File:

randomBg = function () { $Chars = 'abcdef0123456789'; $String = ''; while(6 > strlen($String)) { $String .= substr($Chars, rand() % strlen($Chars), 1); } echo ' style="background-color: #'.$String.'"'; return; } ?>

Example in Config

'plugins' => ['randomBg']

Example in Template

<body=$this->randomBg()?>>

...

⚠️ **GitHub.com Fallback** ⚠️