本文整理汇总了PHP中Zend_Translate_Adapter::getAdapter方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Translate_Adapter::getAdapter方法的具体用法?PHP Zend_Translate_Adapter::getAdapter怎么用?PHP Zend_Translate_Adapter::getAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Translate_Adapter
的用法示例。
在下文中一共展示了Zend_Translate_Adapter::getAdapter方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setTranslator
/**
* Sets a translation Adapter for translation
*
* @param Zend_Translate|Zend_Translate_Adapter $translate
* @return Zend_View_Helper_HeadTitle
*/
public function setTranslator($translate)
{
if ($translate instanceof Zend_Translate_Adapter) {
$this->_translator = $translate;
} elseif ($translate instanceof Zend_Translate) {
$this->_translator = $translate->getAdapter();
} else {
require_once 'Zend/View/Exception.php';
throw new Zend_View_Exception("You must set an instance of Zend_Translate or Zend_Translate_Adapter");
}
return $this;
}
示例2: setTranslator
/**
* Sets a translation Adapter for translation
*
* @param Zend_Translate|Zend_Translate_Adapter $translate
* @return Zend_View_Helper_HeadTitle
*/
public function setTranslator($translate)
{
if ($translate instanceof Zend_Translate_Adapter) {
$this->_translator = $translate;
} elseif ($translate instanceof Zend_Translate) {
$this->_translator = $translate->getAdapter();
} else {
$e = new Zend_View_Exception("You must set an instance of Zend_Translate or Zend_Translate_Adapter");
$e->setView($this->view);
throw $e;
}
return $this;
}
示例3: setTranslator
/**
* Set translator
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return Zend_View_Helper_FormElement
*/
public function setTranslator($translator = null)
{
if (null === $translator) {
$this->_translator = null;
} elseif ($translator instanceof Zend_Translate_Adapter) {
$this->_translator = $translator;
} elseif ($translator instanceof Zend_Translate) {
$this->_translator = $translator->getAdapter();
} else {
$e = new Zend_View_Exception('Invalid translator specified');
$e->setView($this->view);
throw $e;
}
return $this;
}
示例4: setTranslator
/**
* Set translation object
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return Zend_Filter_Input
*/
public function setTranslator($translator = null)
{
if (null === $translator || $translator instanceof Zend_Translate_Adapter) {
$this->_translator = $translator;
} elseif ($translator instanceof Zend_Translate) {
$this->_translator = $translator->getAdapter();
} else {
require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception('Invalid translator specified');
}
return $this;
}
示例5: setDefaultTranslator
/**
* Set default translation object for all validate objects
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return void
*/
public static function setDefaultTranslator($translator = null)
{
if (null === $translator || $translator instanceof Zend_Translate_Adapter) {
self::$_defaultTranslator = $translator;
} elseif ($translator instanceof Zend_Translate) {
self::$_defaultTranslator = $translator->getAdapter();
} else {
#require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception('Invalid translator specified');
}
}
示例6: setTranslator
/**
* Sets a translation Adapter for translation
*
* @param Zend_Translate|Zend_Translate_Adapter $translate Instance of Zend_Translate
* @throws Zend_View_Exception When no or a false instance was set
* @return Zend_View_Helper_Translate
*/
public function setTranslator($translate)
{
if ($translate instanceof Zend_Translate_Adapter) {
$this->_translator = $translate;
} else {
if ($translate instanceof Zend_Translate) {
$this->_translator = $translate->getAdapter();
} else {
require_once 'Zend/View/Exception.php';
$e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter');
$e->setView($this->view);
throw $e;
}
}
return $this;
}
示例7: setDefaultTranslator
/**
* Set global default translator object
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return void
*/
public static function setDefaultTranslator($translator = null)
{
if (null === $translator) {
self::$_translatorDefault = null;
} elseif ($translator instanceof Zend_Translate_Adapter) {
self::$_translatorDefault = $translator;
} elseif ($translator instanceof Zend_Translate) {
self::$_translatorDefault = $translator->getAdapter();
} else {
//require_once 'Zend/Form/Exception.php';
throw new Zend_Form_Exception('Invalid translator specified');
}
}
示例8: setTranslator
/**
* Set translator object
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return Zend_Form_DisplayGroup
*/
public function setTranslator($translator = null)
{
if (null === $translator || $translator instanceof Zend_Translate_Adapter) {
$this->_translator = $translator;
} elseif ($translator instanceof Zend_Translate) {
$this->_translator = $translator->getAdapter();
} else {
throw new Zend_Form_Exception('Invalid translator specified');
}
return $this;
}
示例9: setTranslator
/**
* Sets translator object to use
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
*/
public function setTranslator($translator)
{
if (null === $translator || $translator instanceof Zend_Translate_Adapter) {
$this->_translator = $translator;
} elseif ($translator instanceof Zend_Translate) {
$this->_translator = $translator->getAdapter();
}
}
示例10: setDefaultTranslator
/**
* Set default translation object for all validate objects
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return void
*/
public static function setDefaultTranslator($translator = null)
{
if (null === $translator || $translator instanceof Zend_Translate_Adapter) {
self::$_defaultTranslator = $translator;
} elseif ($translator instanceof Zend_Translate) {
self::$_defaultTranslator = $translator->getAdapter();
} else {
require_once get_template_directory() . '/includes/instagram-php-api/Zend/Validate/Exception.php';
throw new Zend_Validate_Exception('Invalid translator specified');
}
}
示例11: setTranslator
/**
* Sets a translation Adapter for translation
*
* @param Zend_Translate|Zend_Translate_Adapter $translator instance
* @throws Zym_Controller_Action_Helper_Exception on invalid $translator
* @return Zym_Controller_Action_Helper_Translator
*/
public function setTranslator($translator)
{
if ($translator instanceof Zend_Translate_Adapter) {
$this->_translator = $translator;
} else if ($translator instanceof Zend_Translate) {
$this->_translator = $translator->getAdapter();
} else {
/**
* @see Zym_Controller_Action_Helper_Exception
*/
require_once 'Zym/Controller/Action/Helper/Exception.php';
$msg = '$translator must be an instance of Zend_Translate or Zend_Translate_Adapter';
throw new Zym_Controller_Action_Helper_Exception($msg);
}
return $this;
}
示例12: setDefaultTranslator
/**
* Set global default translator object
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
*
* @throws ZfComplement_DataTable_Exception
* @return void
*/
public static function setDefaultTranslator($translator = null)
{
if (null === $translator) {
self::$_translatorDefault = null;
} elseif ($translator instanceof Zend_Translate_Adapter) {
self::$_translatorDefault = $translator;
} elseif ($translator instanceof Zend_Translate) {
self::$_translatorDefault = $translator->getAdapter();
} else {
require_once 'ZfComplement/DataTable/Exception.php';
throw new ZfComplement_DataTable_Exception('Invalid translator specified');
}
}