snipt

Ctrl+h for KB shortcuts

PHP

Get active language in Joomla

1
2
3
4
<?php
	$lang =& JFactory::getLanguage();
	$variable = $lang->getName();
?>
https://snipt.net/embed/c37e985de69136355c26c6c3d8e543da/
https://snipt.net/raw/c37e985de69136355c26c6c3d8e543da/
c37e985de69136355c26c6c3d8e543da
php
PHP
4
2016-09-22T01:50:17
True
False
False
May 18, 2013 at 07:27 AM
/api/public/snipt/58108/
get-active-language-in-joomla
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> <span class="nv">$lang</span> <span class="o">=&amp;</span> <span class="nx">JFactory</span><span class="o">::</span><span class="na">getLanguage</span><span class="p">();</span> </span><span id="L-3"><a name="L-3"></a> <span class="nv">$variable</span> <span class="o">=</span> <span class="nv">$lang</span><span class="o">-&gt;</span><span class="na">getName</span><span class="p">();</span> </span><span id="L-4"><a name="L-4"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
development, joomla, language
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.