{"id":1564,"date":"2017-07-07T11:28:46","date_gmt":"2017-07-07T09:28:46","guid":{"rendered":"https:\/\/www.h-hennes.fr\/blog\/?p=1564"},"modified":"2018-11-22T18:12:14","modified_gmt":"2018-11-22T16:12:14","slug":"prestashop-gerer-les-dependances-de-vos-modules","status":"publish","type":"post","link":"https:\/\/www.h-hennes.fr\/blog\/2017\/07\/07\/prestashop-gerer-les-dependances-de-vos-modules\/","title":{"rendered":"Prestashop : G\u00e9rer les d\u00e9pendances de vos modules"},"content":{"rendered":"<p>Un petit article rapide qui pr\u00e9sente une fonctionnalit\u00e9 qui existe depuis tr\u00e8s longtemps\u00a0 ( version 1.5\u00a0 de prestashop ), la d\u00e9pendances de modules.<br \/>\nPour la mettre en place c&rsquo;est tout simple.<\/p>\n<p>Il vous suffit de rajouter la propri\u00e9t\u00e9 \u00ab\u00a0dependencies\u00a0\u00bb dans la fonction construct de votre module.<br \/>\nAvec le nom du module tel que d\u00e9fini dans son fichier.<\/p>\n<pre lang=\"php\" escaped=\"true\">public function __construct()\r\n    {\r\n        $this-&gt;name = 'samplemodule';\r\n        $this-&gt;tab = 'others';\r\n        $this-&gt;version = '0.1.0';\r\n        $this-&gt;author = 'hhennes';\r\n        $this-&gt;bootstrap = true;\r\n        parent::__construct();\r\n\r\n        $this-&gt;displayName = $this-&gt;l('sample module');\r\n        $this-&gt;description = $this-&gt;l('sample module');\r\n     \r\n        \/\/Mettre ici le nom des modules dont d\u00e9pends votre module\r\n        $this-&gt;dependencies = array('blockcategories');\r\n    }\r\n<\/pre>\n<p>Avant d&rsquo;installer votre module Prestashop v\u00e9rifiera automatiquement si le ou les modules requis sont bien install\u00e9s.<br \/>\nCeci permettra d&rsquo;\u00e9viter les erreurs si votre module d\u00e9pends d&rsquo;information d&rsquo;un autre module \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Un petit article rapide qui pr\u00e9sente une fonctionnalit\u00e9 qui existe depuis tr\u00e8s longtemps\u00a0 ( version 1.5\u00a0 de prestashop ), la d\u00e9pendances de modules. Pour la mettre en place c&rsquo;est tout simple. Il vous suffit de rajouter la propri\u00e9t\u00e9 \u00ab\u00a0dependencies\u00a0\u00bb dans la fonction construct de votre module. Avec le nom du module tel que d\u00e9fini dans [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[245],"tags":[496,361,104],"class_list":["post-1564","post","type-post","status-publish","format-standard","hentry","category-prestashop-2","tag-dependance","tag-modules","tag-prestashop","prestashop-1-5","prestashop-1-6","prestashop-1-7"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/1564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/comments?post=1564"}],"version-history":[{"count":2,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/1564\/revisions"}],"predecessor-version":[{"id":1566,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/1564\/revisions\/1566"}],"wp:attachment":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/media?parent=1564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/categories?post=1564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/tags?post=1564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}