Install smarty
Download http://www.smarty.net
Smartycompressed package smarty-3.1.4.zip
Decompress the package to the specified directory smarty-3.1.4.
Cut the libs Folder: smarty. Class. php
3. Understand core files of smarty
Smarty: High Efficiency and fast speed --- Real-Time
Default delimiter {}
Conflicts may occur if CSS {} is embedded in HTML.
1) re-edit the separator:
<{}>
2) Save the CSS file JS file to another folder separately.
Do not directly modify the configuration information to the original smarty file.
Separately Save the init. Inc. php file
4. Notes for smarty
1) path issues in HTML (TPL) template files
When an external file is introduced into a template file, the relative path used is relative
B. php file.
The template is only responsible for interpreting the variables in the placeholder {}<{}>
Testing by introducing images, CSS files, and JS files
2) location of the HTML (TPL) template file
All are relative
$ TPL-> template_dir = './TPL ';
3) Transfer the PHP file to different directories
Unique absolute path
Echo _ file __;
Echo $ _ server ['script _ filename'];
Gains:
Difference between quotation marks in Regular Expressions
The PHP interpretation engine and the regular expression interpretation engine are separated.
\ S --- match any blank space;
$ Pattern = "// I ";
Echo "\ s"; --- explained by PHP --- \ s -- interpreted by the Regular Expression Engine \ s
Echo '\ s'; --- explained by PHP --- \ s -- interpreted by the Regular Expression Engine \ s
Note: Single and Double quotation marks
1) 'abc' "ABC" -------- same effect
2) '$ A \ B' "$ A \ B" ------- the effect of adding a variable is different.