Something like this should work:

http://book.cakephp.org/view/1441/image

http://www.famfamfam.com/lab/icons/flags/

$links[] = $this->Html->image("/img/flags/" . $code . ".gif'",
array(
        "alt" => $language,
        "url" => array('controller' => '.....', 'action' => '......', $code)
));

Andras Kende
http://www.kende.com

On May 14, 2011, at 12:47 AM, pedrosas wrote:

> I have internationalized application, and I would like to know how I
> can
> add a picture "flag" to each language as I can do to make
> is seen in an array as an example of http://book.cakephp.org
> 
> config/bootstrap.php
> <?php
> Configure::write('Config.language', 'spa');
> 
> Configure::write('Config.languages', array(
>    'spa' => __('Spanish', true),
>    'cat' => __('Catalan', true),
>    'eng' => __('English', true),
>    'ger' => __('German', true),
>    'fre' => __('French', true),
>    'ita' => __('Italian', true)
> ));
> 
> views/layauts/default.ctp
>  <?php
>                $links = array();
>                $currentLanguage = Configure::read('Config.language');
>                foreach (Configure::read('Config.languages') as $code
> => $language) {
>                    if ($code == $currentLanguage) {
>                        $links[] = $language;
>                    } else {
>                        $links[] = $this->Html->link($language,
> array('lang' => $code));
>                    }
>                }
>                echo implode(' - ', $links);
>                ?>
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to