Analysis of assign_dynamic ($tmp) function in Ecshop

Source: Internet
Author: User

Analysis of assign_dynamic ($tmp) function in Ecshop
Recently need to add a PHP page in Ecshop, which involves a number of dynamic article content calls.

Because I didn't do it before, I wrote it against index.php. First, you have added a DWT file, in which an editable area is set. Inside the admin/includes/lib_template.php, a template that can set the content is added to the templatefiles array, NEWS.DWT, in Template_ Files This array adds a template that can set the content, NEWS.DWT, in the array of library items that each template allows to set in Page_libs, adds the ' News ' + array (

'/library/ur_here.lbi ' = 0,

'/library/cart.lbi ' = 0,

'/library/category_tree.lbi ' = 0,

'/library/history.lbi ' = 0,

'/library/pages.lbi ' = 0,

'/library/exchange_hot.lbi ' = 5,

'/library/exchange_list.lbi ' = 0,

), and then in the background "set up template" Here, in languages/zh_cn/admin/template.php to the template file to add the appropriate language, $_lang[' template_files ' [' news '] = ' press page ';

After this setting, in the "Background templates"-"Settings template" Here drop-down box here you can see the new template added. The test found that if you want to display some dynamic content within this page. You must add: assign_dynamic (' News ').

Assign_dynamic (TMP) This function is to live to specify the dynamic content of the page, dynamic processing some local information update without being cached mechanism, where TMP) This function is live to specify the dynamic content of the page, dynamic processing some local information update without being cached mechanism, Where TMP is the template name.

Sql= ' Selectid,number,typefrom '. sql = ' SELECT ID, number, type from '. globals[' ECS ']->table (' template '). "WHERE filename = ' tmp′andtype>0andremarks=" Andtheme

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.