TYPO3 CMS  TYPO3_6-2
TextareaElementView.php
Go to the documentation of this file.
1 <?php
3 
23 
30  public function __construct(\TYPO3\CMS\Form\Domain\Model\Element\TextareaElement $model, $spaces) {
31  parent::__construct($model, $spaces);
32  }
33 
37  public function render() {
38  $content = $this->getLabel() . ': ' . chr(10) . str_repeat(chr(32), ($this->spaces + 4)) . $this->getData();
39  return str_repeat(chr(32), $this->spaces) . $content;
40  }
41 
45  protected function getLabel() {
46  $label = '';
47  if ($this->model->additionalIsSet('label')) {
48  $label = $this->model->getAdditionalValue('label');
49  } else {
50  $label = $this->model->getAttributeValue('name');
51  }
52  return $label;
53  }
54 
58  protected function getData() {
59  $value = str_replace(chr(10), chr(10) . str_repeat(chr(32), ($this->spaces + 4)), $this->model->getData());
60  return $value;
61  }
62 
63 }
__construct(\TYPO3\CMS\Form\Domain\Model\Element\TextareaElement $model, $spaces)