The first is multiple template support:
HTML template that needs to create a new red folder and corresponding action on the TPL
conf.php
Multi-Template Support
' Tmpl_switch_on ' =>true,
' Tmpl_detect_theme ' =>true,
Index.html
<a href= '? t=red ' > Template one </a><br>
<a href= '? t=default ' > Default </a><br>
Multi-language support:
confg.php
Multi-language support//
open MultiLanguage support
' lang_switch_on ' =>true,
///Follow LANG folder name to write
' Default_lang ' => ' ZH-CN ',
//Automatic Detection language
' Lang_auto_detect ' =>true,
Create the corresponding folder language pack, all action public named common.php, for different action named different PHP files; for example user.php
Common code:
<?php
/**
* Chinese files for global modules
* One: templates need to be modified
* Two: config file needs to be modified
*/return
Array (
' Welcome ' => ' welcome ',
' LAN ' => ' 中文版 ', ' usernamenull ' => ' username '
is null ',
);
? >
Set the language way one is set in the common
Design language Mode Two: Set in action, use L function
Shortcut settings language
// L (' demo ', ' Multi-language test ');
referencing and replacing text on a page
Welcome to:<!--{$Think .lang.welcome}--> <br>
language:<!--{$Think .lang.lan}--><br>
demo:<! --{$Think .lang.demo}--><br>
<a href= '? L=ZH-CN ' > Simplified Chinese </a><br>
<a href= '? l= En-US ' >english</a><br>
Set the way to use languages in model:<!--{%welcom}-->; needs to be preceded by a leader
For example, set prompt validation information in model
Protected $_validate=array (
///Add internationalized array to the Model
(' username ', ' require ', ' <!--{%welcom}--> ', 0,0,1),
Array (' username ', ' checklen ', ' username length not valid ', 0, ' callback ', 3),
Array (' Password ', ' require ', ' username required ', 0,0,1),
Array (' Repassword ', ' require ', ' username required ', 0,0,1),
Array (' Password ', ' Repassword ', ' inconsistent password ', 0, ' confirm ', 1),
// Array (' Createip ', ' email ', ' wrong mailbox format ', 0, ' regex ', 1)
;