‪TYPO3CMS  10.4
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 = isset($conf['setCurrent.'])
36  ? $this->cObj->stdWrap($conf['setCurrent'] ?? '', $conf['setCurrent.'])
37  : ($conf['setCurrent'] ?? null);
38  if ($setCurrent) {
39  $this->cObj->data[$this->cObj->currentValKey] = $setCurrent;
40  }
41  $key = isset($conf['key.']) ? $this->cObj->stdWrap($conf['key'], $conf['key.']) : $conf['key'];
42  $key = isset($conf[$key]) && (string)$conf[$key] !== '' ? $key : 'default';
43  // If no "default" property is available, then an empty string is returned
44  if ($key === 'default' && !isset($conf['default'])) {
45  $theValue = '';
46  } else {
47  $theValue = $this->cObj->cObjGetSingle($conf[$key], $conf[$key . '.'] ?? [], $key);
48  }
49  if (isset($conf['stdWrap.'])) {
50  $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
51  }
52  return $theValue;
53  }
54 }
‪TYPO3\CMS\Frontend\ContentObject
Definition: AbstractContentObject.php:16
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
Definition: AbstractContentObject.php:25
‪TYPO3\CMS\Frontend\ContentObject\CaseContentObject\render
‪string render($conf=[])
Definition: CaseContentObject.php:29
‪TYPO3\CMS\Frontend\ContentObject\CaseContentObject
Definition: CaseContentObject.php:22