mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-08 01:37:36 +00:00
- removed @since 2.0.0 as it is a base release - updated version in @since and @deprecated tag taking into account all patch releases
79 lines
1.5 KiB
PHP
79 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
namespace Magento\Backend\Block\Widget\Form;
|
|
|
|
use Magento\Framework\Data\Form;
|
|
|
|
/**
|
|
* Form element widget block
|
|
*
|
|
* @author Magento Core Team <core@magentocommerce.com>
|
|
*/
|
|
class Element extends \Magento\Backend\Block\Template
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $_element;
|
|
|
|
/**
|
|
* @var Form
|
|
*/
|
|
protected $_form;
|
|
|
|
/**
|
|
* @var \Magento\Framework\DataObject
|
|
*/
|
|
protected $_formBlock;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $_template = 'Magento_Backend::widget/form/element.phtml';
|
|
|
|
/**
|
|
* @param string $element
|
|
* @return $this
|
|
*/
|
|
public function setElement($element)
|
|
{
|
|
$this->_element = $element;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @param Form $form
|
|
* @return $this
|
|
*/
|
|
public function setForm($form)
|
|
{
|
|
$this->_form = $form;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @param \Magento\Framework\DataObject $formBlock
|
|
* @return $this
|
|
*/
|
|
public function setFormBlock($formBlock)
|
|
{
|
|
$this->_formBlock = $formBlock;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function _beforeToHtml()
|
|
{
|
|
$this->assign('form', $this->_form);
|
|
$this->assign('element', $this->_element);
|
|
$this->assign('formBlock', $this->_formBlock);
|
|
|
|
return parent::_beforeToHtml();
|
|
}
|
|
}
|