About the meaning of the Pc_tag () method in module _tag.class.php in Phpcms

Source: Internet
Author: User

About the meaning of the Pc_tag () method in module _tag.class.php in Phpcms:
in the PHPCMS system to write their own background module, in the foreground template to be displayed in the \phpcms\modules\ custom module name \classes\ folder to write a "module name _tag.class.php" file, This file outputs the custom PC label used by the front module board, and the method in the label definition class how to write I'm not going to go into this here, because there is a lot of relevant information on the Internet, for example: (http://wenku.baidu.com/link?url= SESC6ZSIC5BJI6LYBI9ZP2ZMUPZOS8ZV-PC07SEOWVDISWVJMWRN098PXNFO7XSAMKL94LMSYS-L3DC2EYR2SIRA_VXUCI1HW4CRASV7CPE), In addition to the ability to use some custom tags in the foreground tab, you can use the method defined in the \phpcms\libs\functions\global.func.php file, which is interesting to see (http://blog.csdn.net/ qzmrock/article/details/7716772) very good to find. I'm here to talk about this tag. Defines the function of the Pc_tag () method in the class file. As I found that the information presented in this area is very small, even on the PHPCMS website there are questions but no answer. I also studied for 2 days to figure out what this method is for, write it out and share it, hoping to help you.
You can find that all of the "module _tag.class.php" file has a Pc_tag () method, which reads "label generation method," the words of gaze, this method is what exactly? In fact, this method is to provide an array, which defines the number of parameters and parameters for the system "template Management, Label Wizard, add Tag Wizard" to provide data. Click the "Join Label Wizard" will pop Up the wizard dialog box, in the "Select Model" drop-down box has all the system installed modules, these modules are read in the \phpcms\caches\configs\modules.php file array of data obtained, you assume that the last line in the array to join ' Custom module ' = = ' module name ', so you can find your custom module name in the drop-down box, then select the module, assuming the system does not find the "custom module" in the \phpcms\phpcms\modules\ Custom Module \classes folder tag.class.php "file, the system will give an error to exit the browser voluntarily, assuming that the file is defined, the system will voluntarily load the Pc_tag () method provided in the array data, the following column section of the data for example analysis:
return arrary (' Action ' =>array (' type_list ' =>l (' guestbook_list ', ' ', ' Guestbook ')),
' type_list ' =>array (
' SiteID ' =>array (' name ' =>l (' site_id ', ' ', ' comment '), ' htmltype ' = ' input_select ', ' data ' = $sitelist,)
........
                                      ),
);
You can see that the Pc_tag () method returns an array in which each variable array represents a line of content in the Label Wizard dialog box. Let's say ' action ' =>array (' type_list ' =>l (' guestbook_list ', ' ', ' Guestbook '), and the next row in the drop-down box of the "Select Model" in the wizard dialog box displays "Select Action:" Guestbook_list such a line of content, here the Guestbook_list is a radio single box label assumes \phpcms\phpcms\languages\zh-cn\ The guestbook.lang.php file defines the guestbook_list of the Chinese character tags such as "message board List", then the "Select operation:" is the "message board list" The words of the label, the array has a few items then the operation will have a few labels display, Assuming that the tag is selected then it will then read the arguments in this array variable, for example, by selecting the guestbook_list tag, then it will read the data in the Type_list array.
' type_list ' =>array (
' SiteID ' =>array (' name ' =>l (' site_id ', ' ', ' comment '), ' htmltype ' = ' input_s ' Elect ', ' data ' = $sitelist,)
another row in the dialog box (Label: Text Box selection dropdown box) respectively corresponding array (L (' site_id ', ' ', ' comment '): input Select) Here the site_id is the site defined in the comment.lang.php file. _id the value of the parameter, the value of the drop-down box is the value in data.


Here you can see it, Pc_tag () method is the system in the Operation page for the front panel to provide a way to add tags, assuming that the user does not need to add their own definition of the new module tag in the _tag.class.php file does not have to define the Pc_tag () method, This has no effect on the display of the foreground template.


About the meaning of the Pc_tag () method in module _tag.class.php in Phpcms

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.