在Shopware中配置主题按钮创建主题期间,在Theme.php中我做了什么错误禁用?

时间:2018-08-08 08:55:54

标签: php shopware

我在Theme.php中添加以下代码,并且当我在后端检查“配置主题”按钮时被禁用。

<?php
namespace Shopware\Themes\NextTheme;
use Doctrine\Common\Collections\ArrayCollection;
use Shopware\Components\Form as Form;
use Shopware\Components\Theme\ConfigSet;

class Theme extends \Shopware\Components\Theme
{
    protected $extend="Responsive";
    protected $name="NextTheme";
    protected $description="";
    protected $licence="";
    protected $inheritanceConfig=false;

    public function createConfig(Form\Container\TabContainer $container)
    {
       $tab=$this->createTab('workshop_tabs','Workshop Tabs',[]);
       $container->addTab($tab);

    }

}

enter image description here

1 个答案:

答案 0 :(得分:1)

我不确定您要执行的操作到底是什么,但是您应该尝试扩展\Shopware\Themes\Responsive\Theme而不是\Shopware\Components\Theme并使用parent::createConfig(),然后添加包含一些元素的自己的标签。< / p>

<?php
namespace Shopware\Themes\NextTheme;
use Doctrine\Common\Collections\ArrayCollection;
use Shopware\Components\Form as Form;
use Shopware\Components\Theme\ConfigSet;

class Theme extends \Shopware\Components\Theme
{
    protected $extend="Responsive";
    protected $name="NextTheme";
    protected $description="";
    protected $licence="";
    protected $inheritanceConfig=false;

    /**
     * @param Form\Container\TabContainer $container
     */
    public function createConfig(Form\Container\TabContainer $container)
    {
        parent::createConfig($container);

        $tab=$this->createTab('workshop_tabs','Workshop Tabs',[]);
        $container->addTab($tab);
    }
}