How to create a new page in prestashop admin panel?

北城余情 提交于 2019-11-27 23:13:19

create controllers/admin/AdminPageController.php with the follwing content:

    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

At BackOffice -> Administration -> Menus -> [Add New]:

Name: Page
Class: AdminPage
Parent: Catalog

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

channasmcs

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');   
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!