Last active
December 19, 2015 21:59
-
-
Save Shagshag/6024164 to your computer and use it in GitHub Desktop.
Custom hook example with Prestashop
This file contains 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 | |
class ExampleModule extends Module { | |
public function install() | |
{ | |
$done = ( | |
parent::install() | |
&& $this->registerHook('displayFooter') | |
&& $this->registerHook('displayRandom') | |
); | |
return $done; | |
} | |
public function hookDisplayFooter($params) | |
{ | |
return $this->display(__FILE__, 'footer.tpl'); | |
} | |
public function hookDisplayRandom($params) | |
{ | |
return rand($params['min'], $params['max']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment