0

是否可以覆盖后端布局?例如后端主菜单(/modules/backend/layouts/_mainmenu.htm)

4

1 回答 1

1

当然,在提出问题后,我找到了解决方案。所以就在这里。

默认情况下,您只能更改用于后端的皮肤。因此,要扩展它,您首先需要创建一个扩展默认后端皮肤信息文件(/modules/backend/skins/Standard.php)的新类

<?php namespace Author\Plugin\Classes;

use Backend\Skins\Standard;

/**
 * Modified backend skin information file.
 *
 * This is modified to include an additional path to override the default layouts.
 *
 */

class BackendSkin extends Standard
{
    /**
     * {@inheritDoc}
     */
    public function getLayoutPaths()
    {
        return [
            base_path() . '/plugins/author/plugin/skin/layouts',
            $this->skinPath . '/layouts'
        ];
    }
}

现在您可以将现有布局复制到该文件夹​​并随意修改它们。

于 2017-01-26T06:18:30.210 回答