Fixing template documentation due recent Twig changes

skala
Julio Montoya 13 years ago
parent 92d9ae9c29
commit c32cbeed7a
  1. 2
      main/inc/lib/template.lib.php
  2. 22
      plugin/show_user_info/template.tpl

@ -280,7 +280,7 @@ class Template {
$this->user_is_logged_in = true;
}
//Setting the $_u array that could be use in any template
$this->assign('_u', $user_info);
$this->assign('_u', $user_info);
}
/* Set system parameters */

@ -1,31 +1,29 @@
{#
This is a Chamilo plugin using Smarty you can use handy shorcuts like:
This is a Chamilo plugin using Twig you can use these handy shorcuts like:
1. Shortcuts
$_p = url chamilo paths
$_u = user information of the current user
_p = url chamilo paths
_u = user information of the current user
2. i18n
You can use i18n variables just use this syntax:
{"HelloWorld"|get_lang}
{{"HelloWorld"|get_lang}}
Now you can add your variables in the main/lang/english/ or main/lang/spanish/ for example in spanish:
Now you can add your variables in the main/lang/english/ or main/lang/spanish/ for example in spanish:
$HelloWorld = "Hola Mundo";
3. Portal settings
3. Portal settings
You can access the portal settings using:
{"siteName"|api_get_setting}
For more settings check the settings_current database
{{"siteName"|get_setting}}
For more settings check the settings_current database table
4. Read more
You can also see more examples in the the main/template/default/layout files
You can also see more examples in main/template/default/layout
#}
{% if show_user_info.show_message is not null %}
{% if show_user_info.show_message is not null and _u.logged == 1 %}
<div class="well">
{{"Welcome"|get_lang}} {{show_user_info.user_info.complete_name}} ({{show_user_info.username}})
<br />

Loading…
Cancel
Save