Templates

Dumb Dog does support some of the major templating engines out there should you want to use one. Personally I'd just stick with PHP "templates" over using an engine as it's much much faster. But people love to complicate things ;-)

 

Twig

See Twig installation on how to install Twig into your project/website.

Now in your index.php define the Twig template engine and include it in Dumb Dog.

// Include the autoload file.
require_once "../vendor/autoload.php";

// Define the template folder for Twig.
$loader = new \Twig\Loader\FilesystemLoader("./website");

// Define the Twig engine.
$engine = new \Twig\Environment(
        $loader,
        [
            "cache" => "../cache"
        ]
);

 

Smarty

See Smarty installation on how to install Smarty into your project/website.

Now in your index.php define the Smarty template engine and include it in Dumb Dog.

// Include the autoload file.
require_once "../vendor/autoload.php";
// Define the Smarty template engine.
$engine = new Smarty();
// Set the Template folder.
$engine->setTemplateDir('./website');
// Set the compile folder.
$engine->setCompileDir('../cache');
// Set Cache folder if you like, speeds stuff up a lot.
$engine->setCacheDir('../cache');

 

Volt

See Phalcon installation on how to install Volt into your project/website.

Now in your index.php define the Volt template engine and include it in Dumb Dog.

$engine = new Phalcon\Mvc\View\Engine\Volt\Compiler();
$engine->setOptions(
    [
        'path' => '../cache/'
    ]
);

 

Blade

See Blade installation on how to install Blade into your project/website.

Now in your index.php define the Blade template engine and include it in Dumb Dog.

$engine = new eftec\bladeone\BladeOne(
    './website',
    '../cache',
    eftec\bladeone\BladeOne::MODE_DEBUG
);

 

Plates

See Plates installation on how to install Plates into your project/website.

Now in your index.php define the Plates template engine and include it in Dumb Dog.

$engine = new League\Plates\Engine('./website');

 

Mustache

See Mustache installation on how to install Mustache into your project/website.

Now in your index.php define the Mustache template engine and include it in Dumb Dog.

$engine = new Mustache_Engine([
    'cache' => '../cache',
    'loader' => new Mustache_Loader_FilesystemLoader(
        dirname(__FILE__) . '/website'
    )
]);