Skip to content
Snippets Groups Projects
Commit 14eb4655 authored by Vladimir Pelipenko's avatar Vladimir Pelipenko
Browse files

Merge commit 'refs/pull/1136/head' of https://github.com/magento/magento2 into prs

parents 84a76c7c 9cfe7c07
Branches
No related merge requests found
......@@ -13,8 +13,28 @@ namespace Magento\Framework\Data\Form\Element;
use Magento\Framework\Escaper;
/**
* @method Textarea setExtType($extType)
* @method mixed getCols()
* @method Textarea setCols($cols)
* @method mixed getRows()
* @method Textarea setRows($rows)
*/
class Textarea extends AbstractElement
{
/**
* default number of rows
*
* @var int
*/
const DEFAULT_ROWS = 2;
/**
* default number of cols
*
* @var int
*/
const DEFAULT_COLS = 15;
/**
* @param Factory $factoryElement
* @param CollectionFactory $factoryCollection
......@@ -30,8 +50,12 @@ class Textarea extends AbstractElement
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->setType('textarea');
$this->setExtType('textarea');
$this->setRows(2);
$this->setCols(15);
if (!$this->getRows()) {
$this->setRows(self::DEFAULT_ROWS);
}
if (!$this->getCols()) {
$this->setCols(self::DEFAULT_COLS);
}
}
/**
......@@ -66,8 +90,8 @@ class Textarea extends AbstractElement
{
$this->addClass('textarea');
$html = '<textarea id="' . $this->getHtmlId() . '" name="' . $this->getName() . '" ' . $this->serialize(
$this->getHtmlAttributes()
) . $this->_getUiId() . ' >';
$this->getHtmlAttributes()
) . $this->_getUiId() . ' >';
$html .= $this->getEscapedValue();
$html .= "</textarea>";
$html .= $this->getAfterElementHtml();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment