Ejemplo n.º 1
0
?>
"/>
            </div>
        </div>
        <div class="form-group">
        <label class="control-label col-sm-5" for="locale"><?php 
echo __('user.register.locale');
?>
</label>
            <div class="col-sm-7">
                <select class="form-control" name="locale" id="locale" type="locale">
                <?php 
$selected = $userinfo['locale'];
?>
                <?php 
foreach (I18n::supported_lang() as $value => $info) {
    ?>
                    <option value="<?php 
    echo $value;
    ?>
" <?php 
    if ($selected == $value) {
        echo 'selected';
    }
    ?>
>
                        <?php 
    echo $info['name'];
    ?>
                    </option>
                <?php 
Ejemplo n.º 2
0
 public function validate()
 {
     if (!in_array($this->locale, I18n::supported_lang())) {
         $this->locale = I18n::default_language();
     }
 }