Created
August 1, 2016 10:10
-
-
Save devudit/0f4434d6b0051ef0e2d984c5031ead23 to your computer and use it in GitHub Desktop.
Multiple Hooks in one extension - Expression Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $hooks = array( | |
| "template_fetch_template" => "template_fetch_template", | |
| "store_order_item_add_start" => "store_order_item_add_start" | |
| ); | |
| foreach ($hooks as $hook => $method){ | |
| $data = array( | |
| 'class' => __CLASS__, | |
| 'method' => $hook, | |
| 'hook' => $method, | |
| 'priority' => 10, | |
| 'settings' => '', | |
| 'version' => $this->version, | |
| 'enabled' => 'y' | |
| ); | |
| ee()->db->insert('extensions', $data); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment