Created
December 8, 2014 07:45
-
-
Save johannessteu/622c56fe15e2d3eb8e0a to your computer and use it in GitHub Desktop.
Use an Eel-Expression in PHP
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
/** @var Site $site */ | |
$site = $this->siteRepository->findOnline()->getFirst(); | |
/** @var ContentContext $context */ | |
$context = $this->contentContextFactory->create(array("currentSite" => $site)); | |
$eelEvaluator = $this->objectManager->get('TYPO3\Eel\EelEvaluatorInterface'); | |
$result = \TYPO3\Eel\Utility::evaluateEelExpression('${q(site).find("myQuery").get()}', $eelEvauator, array("site" => $context->getCurrentSiteNode())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment