Problems with upgrading smarty from 2.x to 3.x

Source: Internet
Author: User

First of all, this is a PHP project about 4 years ago, using Zend framework 1 + smarty 2, which has not been moved for many years,

This project is about to be revised. Take it out and modify it.

To upgrade ZF to 2, consider it again. After all, the project structure must be changed.

You can consider upgrading smarty from 2 to 3.

 

Download the latest version of smarty, mainly to use its built-in support similar to the layout feature in. Net MVC. Of course, ZF has layout, but previously it was just using smarty. Just upgrade it directly.

 

Problems encountered.

  • During the process of ZF integration, it was found that the code changes of smarty2 and smarty 3 were not great, and the Integration Method of smarty2 and ZF was not good. For more information, see:

Http://gediminasm.org/post/smarty-3-extension-for-zend-framework

 

  • If no value is assigned in smarty 2, it is processed by null or false. However, the requirements for smarty3 are strict. If no value is assigned, a warning is given. to make minor changes, add a line $ this-> _ smarty-> error_reporting = e_all & ~ after the smarty instance is instantiated &~ E_notice; this is a XX method and is not recommended. Let's get together first.

 

  • If you want to use the {PHP} {/PHP} label, use smartybc class.
  • Require_once 'smarty/smartybc. Class. php ';
    $ This-> _ smarty = new smartybc ();

     

Problems with upgrading smarty from 2.x to 3.x

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.