Now we can call the get_lang function from the template!!!

skala
Julio Montoya 14 years ago
parent 9937e21b6d
commit 9af85360ce
  1. 5
      main/inc/lib/template.lib.php
  2. 2
      main/template/experimental/layout/layout_two_col.tpl

@ -8,7 +8,7 @@ require_once api_get_path(LIBRARY_PATH).'smarty/Smarty.class.php';
class Template extends Smarty { class Template extends Smarty {
var $style = 'default'; //see the template folder var $style = 'experimental'; //see the template folder
function __construct($title = '') { function __construct($title = '') {
$this->title = $title; $this->title = $title;
@ -48,7 +48,10 @@ class Template extends Smarty {
$this->set_header_parameters(); $this->set_header_parameters();
$this->set_footer_parameters(); $this->set_footer_parameters();
//Now we can call the get_lang from a template!!! Just use {"MyString"|get_lang}
$this->registerPlugin("modifier","get_lang", "get_lang");
//$this->loadPlugin('smarty_function_get_lang');
//$this->caching = Smarty::CACHING_LIFETIME_CURRENT; //$this->caching = Smarty::CACHING_LIFETIME_CURRENT;
$this->assign('style', $this->style); $this->assign('style', $this->style);

@ -5,7 +5,7 @@
{/block} {/block}
{block name=body} {block name=body}
<h1>My experimental Template!!</h1> <h1>{"WelcomeUserXToTheSiteX"|get_lang} </h1>
<div id="maincontent" class="maincontent"> <div id="maincontent" class="maincontent">
{$home_page_block} {$home_page_block}
{$plugin_courses_block} {$plugin_courses_block}

Loading…
Cancel
Save