
$mymodule = new MyModule();
$message = $mymodule->l( 'Welcome to my shop!' );
$smarty->assign( 'messageSmarty', $message ); // creation of our variable
$smarty->display( dirname(__FILE__) . '/mymodule_page.tpl' );
include( '../../footer.php' );
?>
From there on, we can ask Smarty to display the content of this variable
in our TPL file.
mymodule_page.tpl
{$messageSmarty}
PrestaShop includes a number of variables. For instance,
{$HOOK_LEFT_COLUMN} will be replaced with the content for the left
column, meaning the content from all the modules that have been
attached to the left column's hook.
All Smarty variables are global. You should therefore pay attention not to
name your own variable with the name of an existing Smarty variable, in
order to avoid overwriting it. It is good practice to avoid overly simple
names, such as products, and to prefix it with your module's name, or
even your own name, such as: {$mark_mymodule_product}.
Here is a list of Smarty variables that are common to all pages:
URL for the PrestaShop image folder.
URL for the categories images folder.
URL for the languages images folder.
URL for the products images folder.
URL for the manufacturers images folder.
URL for the suppliers images folder.
URL for the carriers (shipping) images folder.
URL for the theme's images folder.
URL for the theme's CSS folder.
URL for the theme's JavaScript folder.
URL for the current theme's folder.
URL for the mail templates folder.
URL for the pictures upload folder.
ISO code for the current language.
URL for the visitor's origin.
Number of products in the cart.
Comentários a estes Manuais