Smarty Template installation configuration, smarty installation configuration
The first step: Download Smarty Template Source PackageBaidu "Smarty Download", download the latest version of the Smarty templatePart II: Unzip, unzip the downloaded
Output: $smarty->display (' Test_color.tpl ');
Assign a value to a template array variable, Template: Test_array.tpl
Output:
Badou
Man
A litte
$people = Array (' name ' => ' crotonic ', ' sex ' => ' man ', ' money ' => ' a little ');
$smarty->assign (' People ', $people);
$smarty->display (' Test_color.tpl ');
Template bl
quotation marks as a property value, and in detail can refer to the embedding of values in double quotes.Example: Take the configuration file configs inside the file test.conf, inside the file as shown.Here is the code that takes the contents of the configuration fileShow results asThis means that you can use this method to remove the properties in the configuration file, you can directly modify the contents of the configuration file to modify the property values.(2) Complex configuration files
Now the development of the site to use the Smarty framework template, feel very good, better realize the PHP source code and the separation of HTML. Now share some common variables of smarty.
1, smarty_dir SMARTY directory
Locate the full system path of the Smarty class file, and if no
Smarty template engine (I) basic knowledge, smarty TemplateI. Basic Concepts 1. What is mvc? Mvc is a development model with core ideas: data input, data processing, and forced separation of data display.2. What is smarty? Smarty is a php template engine. More specifically, it can help developers better separate progra
Smarty template technology, smarty Template
1. What is smarty?Smarty is a php template engine written using php. It provides the separation of logic and external content. In short, it aims to separate php programmers from the artist, changing the program's logic does not affect the page design of the artist. Modifying
The allocation data type of the smarty template engine, and the smarty template data type. The allocation data type of the smarty template engine. The data type of the smarty template is described in this document. Share it with you for your reference. For details, see the distribution data type of the
The YII framework allows developers to write a view of a controller or a pendant using their preferred template syntax (for example, Prado, Smarty). This can be accomplished by writing and installing a viewrenderer application component. This view renderer intercepts cbasecontroller::renderfile calls, compiles the view file with custom template syntax, and then renders the final compilation result. Info: Custom template syntax is recommended only when
Smarty installation and example, and smarty installation example. Smarty installation and example. smarty installation environment: smarty1.download the latest smartypackage at www.smarty.netdownload. select zips for Windows and tar.gz for Linux. Take windows as an example, and install
;//to set the cache effective time (in seconds)$smarty->left_delimiter= "$smarty->right_delimiter= "}>";//Specify Right Label?>Smarty An example of how advanced caching is used/***********index.php***********/Include ("smarty.php");Date_default_timezone_set (' PRC ');$nowt =date (' y-m-d h:i:s ');function Insert_buhuancun () {//locally not cached content (note!)
The basic construction of the smarty template and the creation of the smarty Template
1. Download the smarty template, which is officially available
2. decompress the package. You will need a directory like this.
You can delete all the files except the libs folder (I Don't Know What To use ).
3. Create them in the current directoryTemplates, templates_c, cache,
CI Framework Integration Smarty steps, CI framework smarty Detailed
In this paper, the CI Framework integration smarty step is described in detail. Share to everyone for your reference, as follows:
CI combined with smarty configuration steps:
1. The first step is to configure CI and download
MVC is a development pattern that emphasizes the input, processing, and display of data as forced separation.Smarty Using Tutorials1. How to configure our SmartyAfter decompression, put the Libs folder in the first level of the site directory, and then create two foldersTemplates storing template filesTemplates_c storing the compiled fileThen create the initialization file smarty.ini.phpPrecautions:1. Replacement variable identification delimiter general use Two ways to change a delimiter:1. Cha
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.