File: example-multiple-template-directories.php

package info (click to toggle)
raintpl 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 832 kB
  • sloc: php: 1,433; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

// include
require "library/Rain/autoload.php";

// namespace
use Rain\Tpl;

// config
$config = array(
    "tpl_dir"   => array(
        "templates/multiple-template-directories/newimplement/",
        "templates/multiple-template-directories/base/"
    ),
    "cache_dir" => "cache/",
    "debug"     => true, // set to false to improve the speed
);

Tpl::configure($config);


// Add PathReplace plugin (necessary to load the CSS with path replace)
Tpl::registerPlugin(new Tpl\Plugin\PathReplace());


// create the Tpl object
$tpl = new Tpl;
$tpl->draw("subfolder/index");

?>