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