thinkphp Hook Method ____php

Source: Internet
Author: User

Today I studied the thinkphp hook development, not how to understand, but based on what predecessors do, need to copy the following files in

D:\xampp\htdocs\szxy\trunk\ThinkPHP\Library\Huaqin\Behavior\InitHookBehavior.class.php

D:\xampp\htdocs\szxy\trunk\ThinkPHP\Library\Huaqin\Controller\Addon.class.php

D:\xampp\htdocs\szxy\trunk\ThinkPHP\Library\Huaqin\Controller\AddonsBaseController.class.php

D:\xampp\htdocs\szxy\trunk\ThinkPHP\Library\Huaqin\Common\addons.php (of course need to be require_once at function.php tail) (lib_ PATH. ' huaqin/common/addons.php ' included in it

Because our company's project does not develop hook installation process, so we need to manually write records to the database


This is the Hq_addons and Hq_hooks table record, note that the hooks name must be lowercase,

When we call {: Hook (' Synclogin ', $params)} is the name of the called hooks instead of addons, and this needs to be noted, I've been doing this all day because I thought it was the addons result of the call. Also need to note that there is a cache inside the Inithookbehavior, need to clean up before the line.

The call to {: Hook (' Synclogin ', $params)} is actually the method that executes the hook controller SyncLoginAddon.class.php with Syncloginaddon (the method that has the same name as the controller). about how to develop hooks and then have time to replenish them later.


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.