: This article mainly introduces two common methods for generating static html pages using php. if you are interested in PHP tutorials, refer to them. Because each time a user clicks a dynamic link, the server sends a data query request.
For a
This article mainly introduces the PHP template engine smarty in detail. This article describes the advantages of smarty and smarty, the places that are not suitable for using smarty, and the smarty directory structure and version, for more
: This article mainly introduces the init. PHP file in ecshop. if you are interested in the PHP Tutorial, please refer to it.
Detailed description of the init. php file in ecshop
Under the Directory des/init. php
For work reasons, secondary
: This article mainly introduces the php template engine smarty-display rendering text string. if you are interested in the PHP Tutorial, refer to it. $ Smarty = $ this-> smarty;
$ Smarty-> assign ('foo', 'value ');
$ Template_string = 'display {
: This article describes how to install and tune the Smarty3 module of php. For more information about PHP tutorials, see. When using the Smarty template, in order to split the user interface and business data
Install Smarty, official download URL:
This article mainly introduces the smartyBC class encapsulated by php. It provides effective compatibility and extension for Smarty2 through custom classes. For more information, see the example in this article. We will share this with you for your
Phpsmarty is an example of Chinese interception plug-in development. Smarty is undoubtedly the most popular and famous template engine in php development. by using this template engine, it brings great convenience to our development work. The smarty
Ecshop in the init.php file
Under the includes/init.php directory
For work reasons, need to ecshop two times development, by the way to record some of the Ecshop source code analysis:
The first is the init.php file, which is called on every page of
I know the PHP method for outputting static pages based on the principle of dynamic and static PHP. one is to use the template technology, and the other is to use ob functions. Both methods look similar, but they are actually different.
First: use
Smarty is a php template engine that separates logical programs from external content and provides an easy-to-manage method. smarty requires the web server to run php4.0.6 or later. the smarty library file is required for smarty installation. You
Download the latest Smarty simplest test example to test whether smarty is installed successfully download the latest Smarty: http://smarty.php.net/
Latest version: 2.6.18
Decompress the package and rename the libs directory in the directory to
In WEB development, the most effective way to cope with high traffic is to use the cache technology to effectively improve server load performance. in exchange for space, cache refers to a temporary file exchange zone, the computer puts the most
The smarty static experiment shows that the network is incorrect ~ Haha
The code is as follows:
Require_once ("Smarty/libs/Smarty. class. php ");$ Smarty = new smarty ();$ Smarty-> templates_dir = "templates ";$ Smarty-> templates_c_dir =
Applications related to smarty cache
$ Smarty-> cache-dir = "directory name"; // create a cache directory name
$ Smarty-> caching = true; // enable cache. if it is false, the cache is invalid.
$ Smarty->
: This article mainly introduces the smarty allocation variables of php. if you are interested in the PHP Tutorial, refer to them. Smarty2.php
Require('Smarty/Smarty. class. php ');Require'. /Smarty. inc. php '; global $ _ smarty; $ _ title =
This article mainly introduces the local cache method of the smarty template. For more information, see enable the smarty cache, during the first execution, the compiled output file will be saved to the cache Directory. Then, in the program, the
All Smarty tags are added with delimiters. In Smarty, all content other than the delimiter is static, and when Smarty encounters a template tag, it tries to interpret them and then output them in the proper way.{and} are by default, but they are
Delimiter redefinition prevents errors in Smarty template engine parsing when there is JS CSS code in the template!Note the point:The parameters and values in the TPL page template correspond to the relationships in the PHP page.For examplePHP page
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.