我在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);
}
}
答案 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);
}
}