本文整理汇总了PHP中Magento\Framework\Data\Form\Element\AbstractElement::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractElement::__construct方法的具体用法?PHP AbstractElement::__construct怎么用?PHP AbstractElement::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Data\Form\Element\AbstractElement
的用法示例。
在下文中一共展示了AbstractElement::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Backend\Helper\Data $adminhtmlData
* @param \Magento\Framework\View\Asset\Repository $assetRepo
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Backend\Helper\Data $adminhtmlData, \Magento\Framework\View\Asset\Repository $assetRepo, $data = array())
{
$this->_adminhtmlData = $adminhtmlData;
$this->_assetRepo = $assetRepo;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('file');
}
示例2: __construct
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param array $data
*/
public function __construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, $data = array())
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('select');
$this->setExtType('multiple');
$this->setSize(10);
}
示例3: __construct
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param array $data
*/
public function __construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, $data = [])
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('select');
$this->setExtType('combobox');
$this->_prepareOptions();
}
示例4: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, $data = [])
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('file');
$this->setExtType('imagefile');
$this->setAutosubmit(false);
$this->setData('autoSubmit', false);
}
示例5: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Framework\View\Asset\Repository $assetRepo
* @param \Magento\Backend\Model\UrlFactory $backendUrlFactory
* @param \Magento\Catalog\Helper\Data $catalogData
* @param \Magento\Framework\File\Size $fileConfig
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Backend\Model\UrlFactory $backendUrlFactory, \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\File\Size $fileConfig, array $data = array())
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->_assetRepo = $assetRepo;
$this->_url = $backendUrlFactory->create();
$this->_catalogHelperData = $catalogData;
$this->_fileConfig = $fileConfig;
$this->_maxFileSize = $this->_getFileMaxSize();
}
示例6: __construct
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param array $data
*/
public function __construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, $data = [])
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->_renderer = Form::getFieldsetRenderer();
$this->setType('fieldset');
if (isset($data['advancedSection'])) {
$this->setAdvancedLabel($data['advancedSection']);
}
}
示例7: __construct
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param TimezoneInterface $localeDate
* @param array $data
*/
public function __construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, TimezoneInterface $localeDate, $data = [])
{
$this->localeDate = $localeDate;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('text');
$this->setExtType('textfield');
if (isset($data['value'])) {
$this->setValue($data['value']);
}
}
示例8: __construct
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param array $data
*/
public function __construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, $data = [])
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('textarea');
$this->setExtType('textarea');
if (!$this->getRows()) {
$this->setRows(self::DEFAULT_ROWS);
}
if (!$this->getCols()) {
$this->setCols(self::DEFAULT_COLS);
}
}
示例9: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\Locale\CurrencyInterface $localeCurrency
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Locale\CurrencyInterface $localeCurrency, array $data = [])
{
$this->localeCurrency = $localeCurrency;
$this->storeManager = $storeManager;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
}
示例10: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param UrlInterface $urlBuilder
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, UrlInterface $urlBuilder, $data = [])
{
$this->_urlBuilder = $urlBuilder;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('file');
}
示例11: __construct
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param array $data
*/
public function __construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, $data = [])
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('text');
$this->setLineCount(2);
}
示例12: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Catalog\Helper\Product $helper
* @param \Magento\Framework\Locale\Format $localeFormat
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Framework\Locale\Format $localeFormat, array $data = [])
{
$this->localeFormat = $localeFormat;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
}
示例13: __construct
public function __construct(\Magento\Framework\View\LayoutInterface $layout, Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, array $data = [])
{
$this->layout = $layout;
$this->setType('hidden');
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
}
示例14: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param Escaper $escaper
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, Escaper $escaper, $data = [])
{
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('custom_container');
}
示例15: __construct
/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Framework\View\LayoutInterface $layout
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param array $data
*/
public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Framework\View\LayoutInterface $layout, \Magento\Store\Model\StoreManagerInterface $storeManager, $data = array())
{
$this->_layout = $layout;
$this->_storeManager = $storeManager;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
}