Difference between #4 and #5 of
SEO-conform Multilingual URLs + Language Selector Widget (i18n)

Changes

Title unchanged

SEO-conform Multilingual URLs + Language Selector Widget (i18n)

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

multilanguage, language, seo, i18n, widget

Content changed

[...]
if(sizeof($languages) < 4) {
// Render options as links
$lastElement = end($languages);
foreach($languages as $key=>$lang) {
if($key != $currentLang) {
echo CHtml::link(
$lang,
 
                     $lang, 
 
                    
$this->getOwner()->createMultilanguageReturnUrl($key));
} else echo '<b>'.$lang.'</b>';
if($lang != $lastElement) echo ' | ';
[...]
else {
// Render options as dropDownList
// Use: CHtml::form($action='', $method='post', $htmlOption=array())
 
echo CHtml::form();
 
// for each language, add a hidden field with the MultilanguageReturnUrl for that language. 
echo CHtml::form(); foreach($languages as $key=>$lang) { echo CHtml::hiddenField($key,
 
                $key, 
 
               
$this->getOwner()->createMultilanguageReturnUrl($key));
}
echo CHtml::dropDownList('language', $currentLang, $languages,
array(
'submit'=>'',
)
[...]
28 0
42 followers
Viewed: 77 980 times
Version: 1.1
Category: Tutorials
Written by: c@cba
Last updated by: c@cba
Created on: Dec 29, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history