TYPO3 CMS  TYPO3_6-2
Layout.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Form;
3 
23 
29  protected $layout = array();
30 
36  public function __construct(array $layout = array()) {
37  $this->setLayout($layout);
38  }
39 
51  public function getLayoutByObject($elementName, $layoutDefault, $layoutOverride = '') {
52  if (!empty($layoutOverride)) {
53  $layout = $layoutOverride;
54  } elseif (!empty($this->layout[$elementName])) {
55  $layout = $this->layout[$elementName];
56  } else {
57  $layout = $layoutDefault;
58  }
59  return $layout;
60  }
61 
68  public function setLayout(array $layout = array()) {
69  if (!empty($layout)) {
70  $this->layout = $layout;
71  }
72  return $this;
73  }
74 
83  public function setLayoutByElement($elementName, $layout) {
84  $this->layout[$elementName] = (string) $layout;
85  return $this;
86  }
87 
88 }
setLayoutByElement($elementName, $layout)
Definition: Layout.php:83
setLayout(array $layout=array())
Definition: Layout.php:68
getLayoutByObject($elementName, $layoutDefault, $layoutOverride='')
Definition: Layout.php:51
__construct(array $layout=array())
Definition: Layout.php:36