在 Shopware 配置主题按钮创建主题期间,我在 Theme.php 中做错了什么?
What wrong i am doing in Theme.php during theme creation in Shopware configure theme button goes disable?
我在 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);
}
}
我不确定你到底想做什么,但你应该尝试扩展 \Shopware\Themes\Responsive\Theme
而不是 \Shopware\Components\Theme
并使用 parent::createConfig()
,然后添加你自己的包含一些元素的选项卡.
<?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);
}
}
我在 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);
}
}
我不确定你到底想做什么,但你应该尝试扩展 \Shopware\Themes\Responsive\Theme
而不是 \Shopware\Components\Theme
并使用 parent::createConfig()
,然后添加你自己的包含一些元素的选项卡.
<?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);
}
}