dutom007 Posted March 3, 2010 Share Posted March 3, 2010 Bonjour, Je tente de m'initier aux module, pour ceci j'ai suivi un tuto pdf réalisé par Laurent Raulier.J'ai donc un dossier "onmoduletest" dans le dossier module, et deux fichier à l'interieur:monmoduletest.php: <?php class MonModuleTest extends Module { function __construct() { $this->name = 'monmoduletest'; $this->tab = 'A Module'; $this->version = 0.1; parent::__construct(); $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('My Test Module'); $this->description = $this->l('First step to construct my module'); } function install() { if(parent::install() == false) return false; return true; } public function getContent() { } function hookLeftColumn($params) { global $smarty; return $this->display(__FILE__, 'monmoduletest.tpl'); } function hookRightColumn($params) { return $this->hookLeftColumn($params); } } ?> et monmoduletest.tpl <!-- Block monmoduletest --> {l s='Block' mod='monmoduletest'} href="modules/monmoduletest/class/monmodule.function.php" title="nouvelles fonctions utilisateurs"> {l s='Nouvelles fonctions' mod='blockunmodule'} <!-- /Block monmoduletest --> Malheureusement rien ne s'affiche sur le front...Pourquoi?Merci Link to comment Share on other sites More sharing options...
Nommam Posted March 3, 2010 Share Posted March 3, 2010 function install() { if(parent::install() == false OR $this->registerHook('leftColumn') ) return false; return true; } Tu as oublier de greffer ton module dans le hook Link to comment Share on other sites More sharing options...
Nommam Posted March 3, 2010 Share Posted March 3, 2010 Par convention, marque tes noms de variable en anglais, et texte egalement, apres utilise l'outil trad pour faire du francais Link to comment Share on other sites More sharing options...
Nommam Posted March 3, 2010 Share Posted March 3, 2010 tu as cette lecture aussi : http://www.prestashop.com/forums/viewthread/4466/developpement_et_graphisme/doc__creations_de_module_sous_prestashop__partie_i___ii Link to comment Share on other sites More sharing options...
dutom007 Posted March 3, 2010 Author Share Posted March 3, 2010 Quelle rapidité!C'est exactement ma lecture.. Et j'avais zappé l'ajout pour greffer mon module !Le module s'installe et apparait dans mon front, par contre j'ai l'erreur:Les modules suivants n'ont pas été installés correctement :monmoduletest Link to comment Share on other sites More sharing options...
Nommam Posted March 3, 2010 Share Posted March 3, 2010 <?php class MonModuleTest extends Module { function __construct() { $this->name = 'monmoduletest'; $this->tab = 'A Module'; $this->version = 0.1; parent::__construct(); $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('My Test Module'); $this->description = $this->l('First step to construct my module'); } function install() { if(!parent::install() OR !$this->registerHook('leftColumn')) return false; return true; } public function getContent() { } function hookLeftColumn($params) { global $smarty; return $this->display(__FILE__, 'monmoduletest.tpl'); } function hookRightColumn($params) { return $this->hookLeftColumn($params); } } ?> excuse moi Link to comment Share on other sites More sharing options...
dutom007 Posted March 3, 2010 Author Share Posted March 3, 2010 Impect!allez je continue mes petits test, mais je suis encore loin de parvenir à mes fins ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now