當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Locale::__toString方法代碼示例

本文整理匯總了PHP中Zend_Locale::__toString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Locale::__toString方法的具體用法?PHP Zend_Locale::__toString怎麽用?PHP Zend_Locale::__toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Locale的用法示例。


在下文中一共展示了Zend_Locale::__toString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getLocale

 /**
  * Retrieve locale object
  *
  * @return Zend_Locale
  */
 public function getLocale()
 {
     if (!$this->_locale) {
         $this->setLocale();
     } elseif ($this->_locale->__toString() != $this->_localeCode) {
         $this->setLocale($this->_localeCode);
     }
     return $this->_locale;
 }
開發者ID:ronseigel,項目名稱:agent-ohm,代碼行數:14,代碼來源:Locale.php

示例2: getLocale

 /**
  * Retrieve locale object
  *
  * @return Zend_Locale
  */
 public function getLocale()
 {
     if (!$this->_locale) {
         Zend_Locale_Data::setCache(Mage::app()->getCache());
         $this->_locale = new Zend_Locale($this->getLocaleCode());
     } elseif ($this->_locale->__toString() != $this->_localeCode) {
         $this->setLocale($this->_localeCode);
     }
     return $this->_locale;
 }
開發者ID:codercv,項目名稱:urbansurprisedev,代碼行數:15,代碼來源:Locale.php

示例3: testToString

 /**
  * test toString
  * expected string
  */
 public function testToString()
 {
     $value = new Zend_Locale('de_DE');
     $this->assertEquals('de_DE', $value->toString());
     $this->assertEquals('de_DE', $value->__toString());
 }
開發者ID:jon9872,項目名稱:zend-framework,代碼行數:10,代碼來源:LocaleTest.php

示例4: testToString

 /**
  * test toString
  * expected string
  */
 public function testToString()
 {
     $value = new Zend_Locale('de_DE');
     $this->assertEquals($value->toString(), 'de_DE', 'Locale de_DE expected');
     $this->assertEquals($value->__toString(), 'de_DE', 'Value de_DE expected');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:10,代碼來源:LocaleTest.php

示例5: setLocale

 /**
  * Set current locale in Zend_Locale::setDefault(), Zend_Registry and
  * Adapter.
  *
  * @param Zend_Locale|string $locale
  */
 public static function setLocale($locale = null)
 {
     if (!$locale) {
         $locale = self::findLocale();
     }
     if (is_string($locale)) {
         try {
             $locale = new Zend_Locale($locale);
             if ($locale->__toString() == 'root') {
                 $locale = self::getDefaultLocale();
             }
         } catch (Exception $e) {
             $locale = new Zend_Locale();
         }
     }
     try {
         Zend_Locale::setDefault($locale);
     } catch (Exception $e) {
         Zend_Locale::setDefault(self::getDefaultLocale());
     }
     Zend_Registry::set('Zend_Locale', $locale);
     $adapter = self::getAdapter();
     $adapter->locale = (string) $locale;
     self::$locale = $locale;
 }
開發者ID:massimozappino,項目名稱:zmz,代碼行數:31,代碼來源:Culture.php


注:本文中的Zend_Locale::__toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。