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.