Call FCKeditor file in Smarty
The code is as follows
Copy Code
FCKeditor in Smarty Rossy.cn@gmail.com2007-09-12 13:14Require_once ("conn.php");Require_once ("class/smarty.class.php");$smarty = new Smarty
ObjectiveSmarty is an excellent PHP template engine that separates the logical code from the user interface.
Learning and using smarty, there is no cache technology applied to it is a great loss, it can be the user finally see the HMTL file into a
AdodbZip1.1 has updated and updated the download address.
Smartyzip, a Smarty loading class
Setting parametersSmartyzip:: $zip _url = ' http://www.smarty.net tutorial/distributions/smarty-2.6.26.zip '; [Set item]smarty zip file download
Smarty provides a powerful caching capability. But sometimes we don't want the entire document to be cached, but we have the option to cache a portion of the content or a portion of the content that is not cached. For example, you use a template
Smarty using custom resources, Smarty Custom Resources
The examples in this article describe how Smarty uses custom resources. Share to everyone for your reference. Specific as follows:
query ("sel ECT Tpl_source from my_table where tpl_name= '
Introduction to annotations and truncation in Smarty, introduction of smarty truncation function
CommentsCopy the Code code as follows:{* This is a single-line smarty comment from Jb51.net, the page source code is not visible *}
{* This is a
1,smarty Cache Configuration:
$smarty->cache-dir= "directory name"; Create cache directory Name
$smarty->caching=true; Turn on cache, invalid cache for false
$smarty->cache_lifetime=60; Cache time, Unit is seconds
Use and purge of 2,smarty
Environment: PHP5.2 or laterGo to the official website to download the Smarty Template engine library file to your computer or serverSmarty Official Website library files: https://www.smarty.net/downloadUnzip to local after download is
Data caching
Here is the data cache refers to the database query cache, each visit to the page, will first detect the corresponding cache data exists, if not, connect the database, get the data, and the query results serialized after saving to the
This article demonstrates the power of PHP's three-tier development, PEAR::D b_dataobject for business logic, smarty for display logic, assuming you're familiar with
Notes the Html,smarty,pear::D b_dataobject,mysql and PHP5. If you need additional
Using the DATE function in PHP to format the timestamp, you can use Date_format to implement the SmartySpecific usage:
The code is as follows
Copy Code
{$timestamp |date_fomat: "%y-%m-%d%h:%m:%s"}
Note: | No
The example in this article describes how the Smarty template engine obtains data from PHP. Share to everyone for your reference. Specifically as follows:
Smarty can assign ($smarty->assign) variable types: All PHP-supported data types-basic data
The examples in this article describe the htmlcheckboxes usage of smarty custom functions. Share to everyone for your reference. Specifically as follows:
Access file: index.php:
Copy Code code as follows:
Require_once ('
First, the principle. A camel looked at so much information, found that no matter what method, the principle is the same. is to use the program to read the corresponding data to replace the variables in the template, and then generate a static page.
Smarty Truncate intercept stringIntercepts a length of characters from the beginning of a string, with a default length of 80
Specifies the second parameter as the length of the Intercept string
By default, Smarty is intercepted to the end of a word,
In the Django template, there is the Forloop template variable, quite like the foreach.customers in PHP smarty,
Smarty foreach is as follows:
{foreach name=customers from= $custid item=curr_id}{$smarty. foreach.customers.iteration} {$smarty. Foreach.
The example of this article describes the Smarty date-time operation method. Share to everyone for your reference, specific as follows:
$smarty = new Smarty;
$smarty->assign (' Yesterday ', Strtotime ('-1 day '));
$smarty->display ('
1. reCAPTCHA
The reCAPTCHA library allows you to create an advanced CAPTCHA system for your site that is actually used to generate validation information, even including voice verification. Of course there are recaptcha services that can be used,
Download http://smarty.net;
Unzip---Libs folder rename Smartylibs, placed in the usr/local/lib/of your own server (/USR/LOCAL/LIB/SMARTYLIBS);
Create 4 required folders in the site directory, such as site_a, templates, Templates_c, configs,
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.