Brief introduction to the Smarty3_PHP tutorial

Source: Internet
Author: User
Brief introduction to Smarty3. These days I saw smarty3alpha taking the lead, so I took the time to do a visit investigation. The following text basically comes from readme: basic file structure index. phplibsSmarty. class

These days I saw smarty 3 alpha taking the lead, so I took the time to do a visit investigation. The following text basically comes from its readme:

Basic File structure
Index. php
/Libs/
Smarty. class. php # Master File
/Libs/sysplugins/# internal plugin
Internal .*
/Plugins/# external plugin, which can be expanded freely
Function. mailto. php
Modifier. escape. php
/Templates/# template, which can be a pure php or traditional smarty Template
Index. tpl
Index_view.php: a classic smarty call
Code snippet:
Require (Smarty. class. php );
$ Smarty = newSmarty;
$ Smarty-> assign (foo, bar );
$ Smarty-> display (index. tpl );
It seems no different from the previous version.

SINGLETON
Does this make sense?

Code snippet:
$ Smarty = Smarty: instance ();
Template
The previous smarty template is equivalent to redefining a set of tag languages. Therefore, smarty3 provides a new template that directly supports php syntax.

But the problem arises. Do we still need to use a template?

An example of referencing a php template:

Code snippet:
$ Smarty-> display (php: mytemplate. tpl );
You can directly use the familiar syntax in the template:

If you use a php template, you must solve the security problem yourself. However, this is not a problem for mature teams.

In addition, the newly supported string-type templates feel fierce, and the path from the template is also drifting away:

Code snippet:
$ Smarty-> display (string: This is my template, {$ foo }!);
Smarty3 links
Smarty 3 Alpha with SVN -- selecting the svn service provided by googlecode is quite cost-effective
Smarty 3 developer contact list

Listing 3 alpha took the lead, so it took time to do a visit investigation. The following text basically comes from its readme: basic file structure index. php/libs/Smarty. class...

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.