{"id":470,"date":"2019-06-20T16:19:50","date_gmt":"2019-06-20T14:19:50","guid":{"rendered":"https:\/\/numa-bord.com\/miniblog\/?p=470"},"modified":"2019-06-20T16:28:51","modified_gmt":"2019-06-20T14:28:51","slug":"prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore","status":"publish","type":"post","link":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/","title":{"rendered":"Prestashop : Comment modifier l&rsquo;affichage et les actions d&rsquo;un \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb"},"content":{"rendered":"<p>Nous avons vu dans l&rsquo;article pr\u00e9c\u00e9dent <a href=\"https:\/\/numa-bord.com\/miniblog\/prestashop-les-bases-dun-module-crud\/\">les bases d&rsquo;un module Prestashop<\/a>. Nous allons voir dans cet article comment faire des choses un peu plus pouss\u00e9 en modifiant notre controller qui \u00e9tend \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb. En continuant sur le module de test pr\u00e9c\u00e9dent nous seront donc situ\u00e9 dans le fichier \u00ab\u00a0moduletest\/controller\/admin\/AdminModuleTest.php\u00a0\u00bb<\/p>\n<p><strong>Ajouter des boutons dans la toolbar<\/strong><br \/>\nPar d\u00e9faut la \u00ab\u00a0header toolbar\u00a0\u00bb contient seulement le bouton \u00ab\u00a0aide\u00a0\u00bb, voici comment y ajouter des boutons. Nous ajoutons ici un bouton vers notre formulaire d&rsquo;ajout (un bouton existe d\u00e9j\u00e0 dans la \u00ab\u00a0toolbar\u00a0\u00bb de la liste, mais il sera plus visible \u00e0 ce niveau).<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> initPageHeaderToolbar<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/Bouton d'ajout<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">page_header_toolbar_btn<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'new'<\/span><span class=\"br0\">&#93;<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'href'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"kw2\">self<\/span><span class=\"sy0\">::<\/span><span class=\"re0\">$currentIndex<\/span> <span class=\"sy0\">.<\/span> <span class=\"st_h\">'&amp;add'<\/span> <span class=\"sy0\">.<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">table<\/span> <span class=\"sy0\">.<\/span> <span class=\"st_h\">'&amp;token='<\/span> <span class=\"sy0\">.<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">token<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'desc'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">module<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">l<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'Ajouter un test'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'icon'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'process-icon-new'<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">::<\/span><span class=\"me2\">initPageHeaderToolbar<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p><strong>Bloquer une action existante par d\u00e9faut<\/strong><br \/>\nPar d\u00e9faut diff\u00e9rentes actions existe sur votre objet (ajouter, modifier, supprimer) m\u00eame si les bouton ne sont pas pr\u00e9sent les pages existent et sont accessible. Voici comment bloquer les droits d\u2019acc\u00e8s : <\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> access<span class=\"br0\">&#40;<\/span><span class=\"re0\">$action<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$disable<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw4\">false<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/suppression des droit d'acc\u00e9s \u00e0 la page d'ajout \/ edition<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/in_array\"><span class=\"kw3\">in_array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$action<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'add'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'edit'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">return<\/span> <span class=\"kw4\">false<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">return<\/span> parent<span class=\"sy0\">::<\/span><span class=\"me2\">access<\/span><span class=\"br0\">&#40;<\/span><span class=\"re0\">$action<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$disable<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Et maintenant la petite astuce pour ne pas afficher le bouton d&rsquo;ajout dans la \u00ab\u00a0toolbar\u00a0\u00bb de la liste<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"co1\">\/\/suppression du bouton &quot;ajouter&quot;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> initToolbar<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">::<\/span><span class=\"me2\">initToolbar<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <a href=\"http:\/\/www.php.net\/unset\"><span class=\"kw3\">unset<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">toolbar_btn<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'new'<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p><strong>Permettre d&rsquo;ajouter des case \u00e0 cocher pour supprimer des lignes \u00ab\u00a0en masse\u00a0\u00bb<\/strong><br \/>\nDans notre fonction \u00ab\u00a0__construct\u00a0\u00bb il faut ajouter : <\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/corps de la fonction<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/...<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/ajout de l'option suppression de masse<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">bulk_actions<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'delete'<\/span> <span class=\"sy0\">=&gt;<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'text'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">l<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'Delete selected'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'icon'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'icon-trash'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'confirm'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">l<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'Delete selected items?'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p><strong>Modifier le comportement d&rsquo;une action<\/strong><br \/>\nIl est facile de modifier le comportement des actions existantes (ajout, modification, suppression) en rempla\u00e7ant (override) leur m\u00e9thode. Ci dessous par exemple on modifie l&rsquo;action de \u00ab\u00a0suppression d&rsquo;une ligne\u00a0\u00bb pour supprimer aussi un fichier ayant l&rsquo;id de la ligne si il existe.<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> processDelete<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/suppression classique<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$res<\/span> <span class=\"sy0\">=<\/span> parent<span class=\"sy0\">::<\/span><span class=\"me2\">processDelete<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/on appelle notre fonction de suppression du fichier<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">deleteFile<\/span><span class=\"br0\">&#40;<\/span><span class=\"re0\">$res<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">return<\/span> <span class=\"re0\">$res<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"co1\">\/\/la fonction de suppression du fichier<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">private<\/span> <span class=\"kw2\">function<\/span> deleteFile<span class=\"br0\">&#40;<\/span><span class=\"re0\">$obj<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/si pas d'erreur<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$obj<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/file_exists\"><span class=\"kw3\">file_exists<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'\/chemin\/du\/fichier\/'<\/span> <span class=\"sy0\">.<\/span> <span class=\"re0\">$obj<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">id<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"http:\/\/www.php.net\/unlink\"><span class=\"kw3\">unlink<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'\/chemin\/du\/fichier\/'<\/span> <span class=\"sy0\">.<\/span> <span class=\"re0\">$obj<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">id<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Attention si vous voulez que l&rsquo;action \u00ab\u00a0suppression en masse\u00a0\u00bb r\u00e9alise aussi les suppression de fichiers, il faut alors adapter sa m\u00e9thode.<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">protected<\/span> <span class=\"kw2\">function<\/span> processBulkDelete<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/pour chaque ligne \u00e0 supprimer<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">foreach<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">boxes<\/span> <span class=\"kw1\">as<\/span> <span class=\"re0\">$id<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/je r\u00e9cup\u00e8re l\u2019objet correspondant et j'utilise ma fonction de suppression du fichier <\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$obj<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw2\">new<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">className<\/span><span class=\"br0\">&#40;<\/span><span class=\"re0\">$id<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">deleteFile<\/span><span class=\"br0\">&#40;<\/span><span class=\"re0\">$obj<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/action d'origine<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">return<\/span> parent<span class=\"sy0\">::<\/span><span class=\"me2\">processBulkDelete<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p><strong>Ajouter du contenu au dessus ou en dessous de la liste<\/strong><br \/>\nPour personnaliser la page, par exemple ajouter un bloc de contenu avec une variable personnalis\u00e9 et un bouton au dessus de la liste, nous allons utiliser un template. Il faut cr\u00e9er le fichier \u00ab\u00a0moduletest\/views\/templates\/admin\/prev-content.tpl\u00a0\u00bb qui contiendra ce code :<\/p>\n<div class=\"codecolorer-container html4strict default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"html4strict codecolorer\"><span class=\"sc2\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/div.html\"><span class=\"kw2\">div<\/span><\/a> <span class=\"kw3\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;panel col-lg-12&quot;<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/label.html\"><span class=\"kw2\">label<\/span><\/a>&gt;<\/span>Variable custom :<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><a href=\"http:\/\/december.com\/html\/4\/element\/label.html\"><span class=\"kw2\">label<\/span><\/a>&gt;<\/span> {$variable_custom}<br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/hr.html\"><span class=\"kw2\">hr<\/span><\/a><span class=\"sy0\">\/<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/button.html\"><span class=\"kw2\">button<\/span><\/a> <span class=\"kw3\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;btn btn-primary&quot;<\/span>&gt;<\/span>Bouton d'exemple<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><a href=\"http:\/\/december.com\/html\/4\/element\/button.html\"><span class=\"kw2\">button<\/span><\/a>&gt;<\/span><br \/>\n<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><a href=\"http:\/\/december.com\/html\/4\/element\/div.html\"><span class=\"kw2\">div<\/span><\/a>&gt;<\/span><\/div><\/div>\n<p>Puis adapter dans notre controller la fonction \u00ab\u00a0initContent\u00a0\u00bb :<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> initContent<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">::<\/span><span class=\"me2\">initContent<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/on charge notre template custom auquel on assigne une &quot;variable_custom&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">assign<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'variable_custom'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'nanani-nanana'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$prevContent<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">fetch<\/span><span class=\"br0\">&#40;<\/span>_PS_MODULE_DIR_ <span class=\"sy0\">.<\/span> <span class=\"st_h\">'moduletest\/views\/templates\/admin\/prev-content.tpl'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/que l'on place devant le contenu pr d\u00e9faut<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">assign<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'content'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$prevContent<\/span> <span class=\"sy0\">.<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">content<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>On peux aussi faire une vue compl\u00e8tement personnalis\u00e9, par exemple en utilisant le page \u00ab\u00a0details\u00a0\u00bb. En modifiant notre fonction \u00ab\u00a0renderList\u00a0\u00bb on ajoute un bouton \u00ab\u00a0d\u00e9tails\u00a0\u00bb pour chaque ligne.<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> renderList<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/bouton d\u00e9tails et suppression<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">addRowAction<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'details'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">addRowAction<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'delete'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">return<\/span> parent<span class=\"sy0\">::<\/span><span class=\"me2\">renderList<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Et on adapte \u00ab\u00a0initContent\u00a0\u00bb qui devient : <\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> initContent<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">display<\/span> <span class=\"sy0\">==<\/span> <span class=\"st_h\">'details'<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/chargement de l'objet<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">object<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">loadObject<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/que l'on transmet au template<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">assign<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'object'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">object<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/r\u00e9cup\u00e9ration du template perso<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$content<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">fetch<\/span><span class=\"br0\">&#40;<\/span>_PS_MODULE_DIR_ <span class=\"sy0\">.<\/span> <span class=\"st_h\">'moduletest\/views\/templates\/admin\/details.tpl'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">assign<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'content'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$content<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span> <span class=\"kw1\">else<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">::<\/span><span class=\"me2\">initContent<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/on charge notre template custom auquel on assigne une &quot;variable_custom&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">assign<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'variable_custom'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'nanani-nanana'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$prevContent<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">fetch<\/span><span class=\"br0\">&#40;<\/span>_PS_MODULE_DIR_ <span class=\"sy0\">.<\/span> <span class=\"st_h\">'moduletest\/views\/templates\/admin\/prev-content.tpl'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/que l'on place devant le contenu pr d\u00e9faut<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">context<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">smarty<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">assign<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'content'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"re0\">$prevContent<\/span> <span class=\"sy0\">.<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">content<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>De la m\u00eame fa\u00e7on que pr\u00e9c\u00e9demment on cr\u00e9er le template \u00ab\u00a0moduletest\/views\/templates\/admin\/details.tpl\u00a0\u00bb et pour l&rsquo;exemple ici on y affiche de fa\u00e7on brute notre objet :<\/p>\n<div class=\"codecolorer-container html4strict default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"html4strict codecolorer\"><span class=\"sc2\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/div.html\"><span class=\"kw2\">div<\/span><\/a> <span class=\"kw3\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;panel col-lg-12&quot;<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/pre.html\"><span class=\"kw2\">pre<\/span><\/a>&gt;<\/span>{$object|print_r}<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><a href=\"http:\/\/december.com\/html\/4\/element\/pre.html\"><span class=\"kw2\">pre<\/span><\/a>&gt;<\/span><br \/>\n<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><a href=\"http:\/\/december.com\/html\/4\/element\/div.html\"><span class=\"kw2\">div<\/span><\/a>&gt;<\/span><\/div><\/div>\n<p>Et ce sera pas mal pour commencer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nous avons vu dans l&rsquo;article pr\u00e9c\u00e9dent les bases d&rsquo;un module Prestashop. Nous allons voir dans cet article comment faire des choses un peu plus pouss\u00e9 en modifiant notre controller qui \u00e9tend \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb. En continuant sur le module de test pr\u00e9c\u00e9dent nous seront donc situ\u00e9 dans le fichier \u00ab\u00a0moduletest\/controller\/admin\/AdminModuleTest.php\u00a0\u00bb Ajouter des boutons dans la toolbar Par [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,16],"tags":[],"class_list":["post-470","post","type-post","status-publish","format-standard","hentry","category-developpement","category-prestashop"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Prestashop : Comment modifier l&#039;affichage et les actions d&#039;un &quot;ModuleAdminControllerCore&quot; - Pense b\u00eate d&#039;un d\u00e9veloppeur web<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Prestashop : Comment modifier l&#039;affichage et les actions d&#039;un &quot;ModuleAdminControllerCore&quot; - Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"og:description\" content=\"Nous avons vu dans l&rsquo;article pr\u00e9c\u00e9dent les bases d&rsquo;un module Prestashop. Nous allons voir dans cet article comment faire des choses un peu plus pouss\u00e9 en modifiant notre controller qui \u00e9tend \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb. En continuant sur le module de test pr\u00e9c\u00e9dent nous seront donc situ\u00e9 dans le fichier \u00ab\u00a0moduletest\/controller\/admin\/AdminModuleTest.php\u00a0\u00bb Ajouter des boutons dans la toolbar Par [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\" \/>\n<meta property=\"og:site_name\" content=\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-20T14:19:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-20T14:28:51+00:00\" \/>\n<meta name=\"author\" content=\"Numa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Numa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\"},\"author\":{\"name\":\"Numa\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"headline\":\"Prestashop : Comment modifier l&rsquo;affichage et les actions d&rsquo;un \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb\",\"datePublished\":\"2019-06-20T14:19:50+00:00\",\"dateModified\":\"2019-06-20T14:28:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\"},\"wordCount\":857,\"commentCount\":0,\"articleSection\":[\"D\u00e9veloppement\",\"Prestashop\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\",\"name\":\"Prestashop : Comment modifier l'affichage et les actions d'un \\\"ModuleAdminControllerCore\\\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\"},\"datePublished\":\"2019-06-20T14:19:50+00:00\",\"dateModified\":\"2019-06-20T14:28:51+00:00\",\"author\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"breadcrumb\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/numa-bord.com\/miniblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prestashop : Comment modifier l&rsquo;affichage et les actions d&rsquo;un \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/\",\"name\":\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"description\":\"(php, javascript, Symfony, Wordpress....)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\",\"name\":\"Numa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"caption\":\"Numa\"},\"url\":\"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Prestashop : Comment modifier l'affichage et les actions d'un \"ModuleAdminControllerCore\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/","og_locale":"fr_FR","og_type":"article","og_title":"Prestashop : Comment modifier l'affichage et les actions d'un \"ModuleAdminControllerCore\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web","og_description":"Nous avons vu dans l&rsquo;article pr\u00e9c\u00e9dent les bases d&rsquo;un module Prestashop. Nous allons voir dans cet article comment faire des choses un peu plus pouss\u00e9 en modifiant notre controller qui \u00e9tend \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb. En continuant sur le module de test pr\u00e9c\u00e9dent nous seront donc situ\u00e9 dans le fichier \u00ab\u00a0moduletest\/controller\/admin\/AdminModuleTest.php\u00a0\u00bb Ajouter des boutons dans la toolbar Par [&hellip;]","og_url":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/","og_site_name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","article_published_time":"2019-06-20T14:19:50+00:00","article_modified_time":"2019-06-20T14:28:51+00:00","author":"Numa","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Numa","Dur\u00e9e de lecture estim\u00e9e":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#article","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/"},"author":{"name":"Numa","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"headline":"Prestashop : Comment modifier l&rsquo;affichage et les actions d&rsquo;un \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb","datePublished":"2019-06-20T14:19:50+00:00","dateModified":"2019-06-20T14:28:51+00:00","mainEntityOfPage":{"@id":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/"},"wordCount":857,"commentCount":0,"articleSection":["D\u00e9veloppement","Prestashop"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/","url":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/","name":"Prestashop : Comment modifier l'affichage et les actions d'un \"ModuleAdminControllerCore\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/#website"},"datePublished":"2019-06-20T14:19:50+00:00","dateModified":"2019-06-20T14:28:51+00:00","author":{"@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"breadcrumb":{"@id":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/numa-bord.com\/miniblog\/prestashop-comment-modifier-laffichage-et-les-actions-dun-moduleadmincontrollercore\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/numa-bord.com\/miniblog\/"},{"@type":"ListItem","position":2,"name":"Prestashop : Comment modifier l&rsquo;affichage et les actions d&rsquo;un \u00ab\u00a0ModuleAdminControllerCore\u00a0\u00bb"}]},{"@type":"WebSite","@id":"https:\/\/numa-bord.com\/miniblog\/#website","url":"https:\/\/numa-bord.com\/miniblog\/","name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","description":"(php, javascript, Symfony, Wordpress....)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Person","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e","name":"Numa","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","caption":"Numa"},"url":"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/"}]}},"_links":{"self":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/comments?post=470"}],"version-history":[{"count":25,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":504,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/470\/revisions\/504"}],"wp:attachment":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/media?parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/categories?post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/tags?post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}