sfContext::getI18N PHP Метод

getI18N() публичный Метод

Retrieve the i18n instance
public getI18N ( ) : sfI18N
Результат sfI18N The current sfI18N implementation instance.
    public function getI18N()
    {
        if (!sfConfig::get('sf_i18n')) {
            throw new sfConfigurationException('You must enable i18n support in your settings.yml configuration file.');
        }
        return $this->factories['i18n'];
    }

Usage Example

Пример #1
0
 /**
  * Function loads all translations for the textfields and combobox
  *
  * @param user $conext
  * @return array $result
  */
 public function loadAjaxLanguage(sfContext $context) {
     $result = array();
     $result['login'] = $context->getI18N()->__('Login',null,'login');
     $result['username'] = $context->getI18N()->__('Username',null,'login');
     $result['password'] = $context->getI18N()->__('Password',null,'login');
     $result['language'] = $context->getI18N()->__('Language',null,'login');
     $result['close'] = $context->getI18N()->__('Close',null,'login');
     return $result;
 }
All Usage Examples Of sfContext::getI18N