6

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

 <?php
class AdminPageController extends AdminController {
public function __construct()
{
    parent::__construct();
}

public function initContent()
{
    parent::initContent();
 $this->setTemplate(_PS_THEME_DIR_.'mypage.tpl');
}
}
4

2 回答 2

18

使用以下内容创建 controllers/admin/AdminPageController.php:

    class AdminPageController extends AdminController
    {
        public function initContent()
        {
            parent::initContent();
            $smarty = $this->context->smarty;

            $smarty->assign('test', 'test1');

        }
    }

删除:/cache/class_index.php

创建:admin\themes\default\template\controllers\page\content.tpl

zzz{$test}zzz

在 BackOffice -> 管理 -> 菜单 -> [添加新]:

Name: Page
Class: AdminPage
Parent: Catalog

单击[保存]按钮,菜单项应出现在“目录”菜单中。

于 2013-10-21T17:57:06.803 回答
-1

会是这样

class AdminPageController extends AdminController
{
    public function __construct()    
    {    
         parent::__construct();        
    }

    public function initContent()    
    {
        parent::initContent();       
        $this->setTemplate(_PS_THEME_DIR_.'mypage.tpl');   
    }
}
于 2014-02-24T03:54:28.273 回答