Skip to content

Instantly share code, notes, and snippets.

@johannessteu
Created December 8, 2014 07:45
Show Gist options
  • Save johannessteu/622c56fe15e2d3eb8e0a to your computer and use it in GitHub Desktop.
Save johannessteu/622c56fe15e2d3eb8e0a to your computer and use it in GitHub Desktop.
Use an Eel-Expression in PHP
/** @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