Skip to content

Commit 9a205dd

Browse files
committed
Use $contentObject->data
1 parent 20adfb9 commit 9a205dd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Documentation/ContentObjects/Extbaseplugin/_CodeSnippets/_MyController.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ public function listAction(): ResponseInterface
1414
{
1515
/** @var ContentObjectRenderer $contentObject */
1616
$contentObject = $this->request->getAttribute('currentContentObject');
17-
$dataFromTypoScript = $contentObject->getCurrentVal();
18-
if (is_array($dataFromTypoScript)) {
19-
$someValue = (int)($dataFromTypoScript['someValue'] ?? 0);
20-
$someSetting = $dataFromTypoScript['someSetting'] ?? '';
21-
// Do something
22-
}
17+
$dataFromTypoScript = $contentObject->data;
18+
$someValue = (int)($dataFromTypoScript['someValue'] ?? 0);
19+
$someSetting = $dataFromTypoScript['someSetting'] ?? '';
20+
// Do something
2321
return $this->htmlResponse();
2422
}
2523
}

0 commit comments

Comments
 (0)