How to create a new page in prestashop admin panel?

how to create a new page in prestashop admin panel? I tried to use the creation of a new controller controller file and in this set the path to the template, and I created the menu using the admin panel, and there I mentioned the controller class name for this menu. when I try to open this menu, it always shows that the controller was not found. can anyone help me how to create a new page in prestashop admin panel? I am using PS version 1.5.

<?php class AdminPageController extends AdminController { public function __construct() { parent::__construct(); } public function initContent() { parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'mypage.tpl'); } } 
+6
source share
2 answers

create the /admin/AdminPageController.php controllers with the following contents:

  class AdminPageController extends AdminController { public function initContent() { parent::initContent(); $smarty = $this->context->smarty; $smarty->assign('test', 'test1'); } } 

Delete: /cache/class_index.php

Create: admin \ themes \ default \ template \ controllers \ page \ content.tpl

 zzz{$test}zzz 

In BackOffice → Administration → Menu → [Add New]:

 Name: Page Class: AdminPage Parent: Catalog 

Click the [Save] button, and the menu item should appear in the "Catalog" menu.

+17
source

it will be like this:

 class AdminPageController extends AdminController { public function __construct() { parent::__construct(); } public function initContent() { parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'mypage.tpl'); } } 
-1
source

Source: https://habr.com/ru/post/956393/


All Articles