definition requires code that is normally placed in the source file . Standard C + + Two models have been defined for compiling template code . In both models, the way in which a program is constructed is largely the same: class definitions and function declarations are placed in the header file , and function definitions and member definitions are placed in the source file . The difference between the two models is how the compiler uses the d
corresponding to the template or a public file common. php in the folder.
En-cn/common. php page:
The en-us/common. php page is as follows:
The zh-tw/common. php page is as follows:
The template index. php code is as follows:
Welcome: {$ Think. lang. welcome} language: {$ Think. lang. lan} simplified Chinese english traditional Chinese
Or you can directly define L ('demo', 'test') in the Action
. welcome} language: {$ Think. lang. lan} simplified Chinese english traditional Chinese
Or you can directly define L ('demo', 'test') in the Action method. in this way, you can directly apply it in the template: {$ Think. lang. demo}In the model, for example, array ('uname', 'require ', 'username mandatory'); can be used as follows: array ('uname', 'require ', '% name ');
II.
} simplified Chinese english traditional Chinese
Or you can directly define L ('demo', 'test') in the Action method. in this way, you can directly apply it in the template: {$ Think. lang. demo}In the model, for example, array ('uname', 'require ', 'username mandatory'); can be used as follows: array ('uname', 'require ', '% name ');
II. support for multiple Thi
',
'Usernamenable' => 'username is Null ',
);
?>
Set Language 1 in common
Design language Method 2: Set in Action and use the L function
[Php]
// Shortcut language
L ('demo', 'multilingual test ');
Reference and replace text on the page
[Html] www.2cto.com
Welcome:
Language:
Demo:
Simplified Chinese
English
Set the language used in the Model:
; A leading character must be added.
For example, set the prompt verification informatio
. In this way, you can directly apply it in the template: {$ Think. lang. demo}In the model, for example, array ('uname', 'require ', 'username mandatory'); can be used as follows: array ('uname', 'require ', '% name ');
Ii. Support for multiple ThinkPHP templates:
Add the following to the config. php configuration file:
// Multiple templates
be directly applied: {$Think. Lang.demo}For the model, for example: Array (' uname ', ' Require ', ' user name must be filled in '), can be used so: Array (' uname ', ' require ', '%name ');
Second, thinkphp Multi-template support:
config.php configuration file Add:
Multi-template
: "like a stack of the same Board (And the reason for calling it a plate is because the intuition ofthis is a stack of identical plates, that's kind of where the idea comes from, fora plate model.)"
The Board draws a small box around the output variable and writes the index of the output variable in the lower right corner of the box. For example, the duplicate score model is indexed by student s:
Nested
The first is multiple template support:
HTML template that needs to create a new red folder and corresponding action on the TPL
conf.phpMulti-Template Support' Tmpl_switch_on ' =>true,' Tmpl_detect_theme ' =>true,
Index.html
Multi-language
Generics are a concept. templates in C ++ support and implement generics.---------------------------------------------------------------
To put it simply, generic programming is a kind of thinking model that "converts data types into values. The C ++ template mechanism is a specific vehicle of generic technology. In C ++, whether it is functions or classes, you
model.The so-called inclusion of the compilation model, plainly, is to put the definition of function template in the header file. Therefore, for the above example, the content of Temp.cpp is put into temp.h.There is a problem with the compilation model, and if two or more separate compiled source files use the same template
ThinkPHP learning notes (13) multi-template support and multi-language support first, multi-template support: you need to create a red folder and the corresponding action html template conf On The tpl. php // multi-
This paper analyzes the support mechanism of YII dynamic model (dynamic table name). Share to everyone for your reference, specific as follows:
Add dynamic model support to YII framework
The data model in the YII framework uses a static mechanism, and if you want to manipu
changed to a nullable type. Specific settings: Tools-Options-Code Parameters-field type mapping [Isvaluetype] segment;If you don't, you can delete the corresponding fields in the configuration file.2. Batch code generation, table name unified go to prefix function3. Code generator Add code Save function4. Added efficient connection mode: Enable this for fast connection in case of a large number of tables.5. Added support for MySQL database.6. Query A
Error code:
File 1: Listing list. h
// Configure list. htemplate
According to the C ++ primer version 4 description of the model containing the compilation (page 1), divide the definition and declaration of the function Template into two files, however, the following error occurs during the compilation test:
Error 1 error c2143: syntax error: Missing ";" (before "E: \ document \ Documents \ Visual Studio
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.