Install and configure smarty

Source: Internet
Author: User
Tags expression engine

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.

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.