如何在prestashop管理面板中创建新页面? [英] How to create a new page in prestashop admin panel?

查看:120
本文介绍了如何在prestashop管理面板中创建新页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在prestashop管理面板中创建新页面?我尝试使用创建一个新的管理控制器文件,并在其中设置了模板路径,并使用管理面板创建了一个菜单,在那里我提到了该菜单的控制器类名称.当我尝试打开该菜单时,它始终显示未找到该控制器.谁能帮助我,如何在prestashop管理面板中创建新页面?正在使用PS 1.5版本.

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');
}
}

推荐答案

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

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');

        }
    }

删除:/cache/class_index.php

Delete: /cache/class_index.php

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

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

zzz{$test}zzz

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

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.

这篇关于如何在prestashop管理面板中创建新页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆