‪TYPO3CMS  ‪main
CaseContentObject.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
22 {
29  public function ‪render($conf = [])
30  {
31  if (!empty($conf['if.']) && !$this->cObj->checkIf($conf['if.'])) {
32  return '';
33  }
34 
35  $setCurrent = $this->cObj->stdWrapValue('setCurrent', $conf);
36  if ($setCurrent) {
37  $this->cObj->data[$this->cObj->currentValKey] = $setCurrent;
38  }
39  $key = $this->cObj->stdWrapValue('key', $conf, null);
40  $key = isset($conf[$key]) && (string)$conf[$key] !== '' ? $key : 'default';
41  // If no "default" property is available, then an empty string is returned
42  if ($key === 'default' && !isset($conf['default'])) {
43  $theValue = '';
44  } else {
45  $theValue = $this->cObj->cObjGetSingle($conf[$key], $conf[$key . '.'] ?? [], $key);
46  }
47  if (isset($conf['stdWrap.'])) {
48  $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
49  }
50  return $theValue;
51  }
52 }
‪TYPO3\CMS\Frontend\ContentObject
Definition: AbstractContentObject.php:18
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
Definition: AbstractContentObject.php:31
‪TYPO3\CMS\Frontend\ContentObject\CaseContentObject\render
‪string render($conf=[])
Definition: CaseContentObject.php:29
‪TYPO3\CMS\Frontend\ContentObject\CaseContentObject
Definition: CaseContentObject.php:22