Created
December 24, 2014 12:41
-
-
Save sbruggmann/d448628f3e50f97c4135 to your computer and use it in GitHub Desktop.
Access Nodes in a TYPO3 Neos Package Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Package\Controller; | |
class PersonsController extends ActionController { | |
/** | |
* @return void | |
*/ | |
public function personsAction() { | |
$currentDocumentNode = $this->request->getInternalArgument('__documentNode'); | |
if ($currentDocumentNode !== NULL) { | |
$parentNode = $currentDocumentNode->getParent(); | |
$personsNode = $parentNode->getNode('persons'); | |
foreach ($personsNode->getChildNodes() as $personNode) { | |
if ( $personNode->getProperty('maincontactfor') ) { | |
// do something great.. | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment