Skip to content

Instantly share code, notes, and snippets.

@sbruggmann
Created December 24, 2014 12:41
Show Gist options
  • Save sbruggmann/7e6e234312558764f44d to your computer and use it in GitHub Desktop.
Save sbruggmann/7e6e234312558764f44d to your computer and use it in GitHub Desktop.
Get current Language in TYPO3 Neos Controller
<?php
namespace My\Custom\Controller;
use TYPO3\Flow\Annotations as Flow;
class StandardController extends \TYPO3\Flow\Mvc\Controller\ActionController {
/**
* @Flow\Inject
* @var \TYPO3\Flow\I18n\Service
*/
protected $i18nService;
/**
* @return void
*/
public function indexAction() {
exit( (string)$this->i18nService->getConfiguration()->getCurrentLocale() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment