This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » [EZ 5.3] - Get language code of...
expandshrink

[EZ 5.3] - Get language code of current site access in PHP

[EZ 5.3] - Get language code of current site access in PHP

Tuesday 10 June 2014 5:06:51 pm - 2 replies

Hello all,

Is there a way to get language code for the current site access in PHP ?

Tkx

Tuesday 10 June 2014 5:35:13 pm

Hi Clem.

You can get prioritized languages from the ConfigResolver

// Assuming you're in a controller.
// If using a service, inject ezpublish.config.resolver service as a parameter.
$languages = $this->getConfigResolver()->getParameter( 'languages' ); 

$languages will be an array of prioritized languages. Just use the first entry happy.gif Emoticon

Tuesday 10 June 2014 6:54:34 pm

Hello,

It's perfect ! i was afraid that this function got the language in legacy settings, but it is ok because it searches in stack settings ! blunk.gif Emoticon

 

Tkx for your help

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from