TYPO3 CMS  TYPO3_6-2
CheckboxElementView.php
Go to the documentation of this file.
1 <?php
3 
23 
30  public function __construct(\TYPO3\CMS\Form\Domain\Model\Element\CheckboxElement $model, $spaces) {
31  parent::__construct($model, $spaces);
32  }
33 
37  public function render() {
38  $content = $this->getValue();
39  if (empty($content) === FALSE) {
40  $content = str_repeat(chr(32), $this->spaces) . $content;
41  }
42  return $content;
43  }
44 
48  protected function getValue() {
49  $value = NULL;
50  if (array_key_exists('checked', $this->model->getAllowedAttributes()) && $this->model->hasAttribute('checked')) {
51  if ($this->model->additionalIsSet('label')) {
52  $value = $this->model->getAdditionalValue('label');
53  } else {
54  $value = $this->model->getAttributeValue('value');
55  if ($value === '') {
56  $value = $this->model->getAttributeValue('name');
57  }
58  }
59  }
60  return $value;
61  }
62 
63 }
__construct(\TYPO3\CMS\Form\Domain\Model\Element\CheckboxElement $model, $spaces)