Skip to content

Instantly share code, notes, and snippets.

@Shagshag
Last active December 19, 2015 21:59
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Shagshag/6024164 to your computer and use it in GitHub Desktop.
Custom hook example with Prestashop
<?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