Prestashop - 1.4 Uživatelská příručka Strana 16

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 36
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 15
PrestaShop automatically creates a small config.xml file in the module's
folder, which stores a few configuration information. You should NEVER
edit it by hand.
On installation, PrestaShop also adds a line to the ps_module SQL table.
Hooking a module
Displaying data, starting a process at a specific time: in order for a
module to be "attached" to a location on the front-office or the back-
office, you need to give it access to one of the many PrestaShop hooks,
described earlier in this guide.
To that effect, we are going to change your module's code, and add these
lines:
mymodule.php (partial)
public function install()
{
if ( parent::install() == false OR !$this->registerHook( 'leftColumn' ) )
return false;
return true;
}
...
public function hookLeftColumn( $params )
{
global $smarty;
return $this->display( __FILE__, 'mymodule.tpl' );
}
public function hookRightColumn( $params )
{
return $this->hookLeftColumn( $params );
}
Let's explore these new or changed lines.
Zobrazit stránku 15
1 2 ... 11 12 13 14 15 16 17 18 19 20 21 ... 35 36

Komentáře k této Příručce

Žádné komentáře