Project

General

Profile

Actions

Twig conf

  1. Configuration of Template : Twig chamilo 1.9

Started : files defined for configuration.

index.php
main/inc/global.inc.php    : constans and variables of languagues
main/inc/autoload.inc.php
    main/inc/lib/autoload.class.php (autoload)
    $result['Template'] = '/main/inc/lib/template.lib.php';

Here is settings the folder of Cache that use twig for render html

$loader = new Twig_Loader_Filesystem($template_paths);
$this->twig = new Twig_Environment($loader, $options);

Setting variable of configurations :
ref : main/template/default/layout/main_header.tpl:10

    $this->twig->addFilter('get_lang', new Twig_Filter_Function('get_lang'));
// Example render html
    <noscript>{{ "NoJavascript"|get_lang }}</noscript>  {{ "WEB_PATH"|get_path }}

get_lang : Its use function : main/inc/lib/internationalization.lib.php
api_get_path : Its use function : /main/inc/lib/main_api.lib.php

The lines below definie the variables, helper : Css,Js, HeaderScript, BreadCrumb
and other varibles.

Updated by anibal copitan about 5 years ago · 2 revisions