Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Data
Form
Element
Textarea.php
Go to the documentation of this file.
1
<?php
12
namespace
Magento\Framework\Data\Form\Element
;
13
14
use
Magento\Framework\Escaper
;
15
16
class
Textarea
extends
AbstractElement
17
{
21
const
DEFAULT_ROWS
= 2;
22
26
const
DEFAULT_COLS
= 15;
27
34
public
function
__construct
(
35
Factory
$factoryElement,
36
CollectionFactory
$factoryCollection,
37
Escaper
$escaper,
38
$data
= []
39
) {
40
parent::__construct($factoryElement, $factoryCollection, $escaper,
$data
);
41
$this->
setType
(
'textarea'
);
42
$this->setExtType(
'textarea'
);
43
if
(!$this->getRows()) {
44
$this->setRows(self::DEFAULT_ROWS);
45
}
46
if
(!$this->getCols()) {
47
$this->setCols(self::DEFAULT_COLS);
48
}
49
}
50
56
public
function
getHtmlAttributes
()
57
{
58
return
[
59
'title'
,
60
'class'
,
61
'style'
,
62
'onclick'
,
63
'onchange'
,
64
'rows'
,
65
'cols'
,
66
'readonly'
,
67
'disabled'
,
68
'onkeyup'
,
69
'tabindex'
,
70
'data-form-part'
,
71
'data-role'
,
72
'data-action'
73
];
74
}
75
81
public
function
getElementHtml
()
82
{
83
$this->
addClass
(
'textarea admin__control-textarea'
);
84
$html =
'<textarea id="'
. $this->
getHtmlId
() .
'" name="'
. $this->
getName
() .
'" '
85
. $this->
serialize
($this->
getHtmlAttributes
()) . $this->
_getUiId
() .
' >'
;
86
$html .= $this->
getEscapedValue
();
87
$html .=
"</textarea>"
;
88
$html .= $this->
getAfterElementHtml
();
89
return
$html;
90
}
91
}
Magento\Framework\Data\Form\Element\CollectionFactory
Definition:
CollectionFactory.php:10
Magento\Framework\Data\Form\Element\Textarea\DEFAULT_ROWS
const DEFAULT_ROWS
Definition:
Textarea.php:21
Magento\Framework\Data\Form\Element\AbstractElement\_getUiId
_getUiId($suffix=null)
Definition:
AbstractElement.php:333
Magento\Framework\Data\Form\Element\Factory
Definition:
Factory.php:14
Magento\Framework\Data\Form\Element\Textarea\getHtmlAttributes
getHtmlAttributes()
Definition:
Textarea.php:56
Magento\Framework\Escaper
Definition:
Escaper.php:15
Magento\Framework\Data\Form\Element\AbstractElement\getName
getName()
Definition:
AbstractElement.php:182
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\Data\Form\Element\AbstractElement\addClass
addClass($class)
Definition:
AbstractElement.php:257
Magento\Framework\Data\Form\Element\AbstractElement\getEscapedValue
getEscapedValue($index=null)
Definition:
AbstractElement.php:297
Magento\Framework\Data\Form\Element\Textarea
Definition:
Textarea.php:16
Magento\Framework\Data\Form\Element\AbstractElement\getHtmlId
getHtmlId()
Definition:
AbstractElement.php:172
Magento\Framework\Data\Form\Element\Textarea\DEFAULT_COLS
const DEFAULT_COLS
Definition:
Textarea.php:26
Magento\Framework\Data\Form\Element\AbstractElement\setType
setType($type)
Definition:
AbstractElement.php:197
Magento\Framework\Data\Form\Element\AbstractElement\serialize
serialize($attributes=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
Definition:
AbstractElement.php:486
Magento\Framework\Data\Form\Element\Textarea\__construct
__construct(Factory $factoryElement, CollectionFactory $factoryCollection, Escaper $escaper, $data=[])
Definition:
Textarea.php:34
Magento\Framework\Data\Form\Element
Definition:
AbstractElement.php:6
Magento\Framework\Data\Form\Element\Textarea\getElementHtml
getElementHtml()
Definition:
Textarea.php:81
Magento\Framework\Data\Form\Element\AbstractElement\getAfterElementHtml
getAfterElementHtml()
Definition:
AbstractElement.php:393
Magento\Framework\Data\Form\Element\AbstractElement
Definition:
AbstractElement.php:21