Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Element.php
Go to the documentation of this file.
1 <?php
7 
9 
16 {
20  protected $_element;
21 
25  protected $_form;
26 
30  protected $_formBlock;
31 
35  protected $_template = 'Magento_Backend::widget/form/element.phtml';
36 
41  public function setElement($element)
42  {
43  $this->_element = $element;
44  return $this;
45  }
46 
51  public function setForm($form)
52  {
53  $this->_form = $form;
54  return $this;
55  }
56 
61  public function setFormBlock($formBlock)
62  {
63  $this->_formBlock = $formBlock;
64  return $this;
65  }
66 
70  protected function _beforeToHtml()
71  {
72  $this->assign('form', $this->_form);
73  $this->assign('element', $this->_element);
74  $this->assign('formBlock', $this->_formBlock);
75 
76  return parent::_beforeToHtml();
77  }
78 }
$element
Definition: element.phtml:12