本文整理匯總了PHP中Seitenbau\Registry::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registry::get方法的具體用法?PHP Registry::get怎麽用?PHP Registry::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Seitenbau\Registry
的用法示例。
在下文中一共展示了Registry::get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _
/**
* @param string $key
* @param Seitenbau\Locale $locale
* @return string
*/
protected static function _($key, $locale = null)
{
if (is_null($locale)) {
$locale = Registry::getLocale('Zend_Translate');
}
return Registry::get('Zend_Translate')->_($key, $locale);
}
示例2: setCurrentLang
/**
* @param string $lang
* @return void
*/
protected function setCurrentLang($lang)
{
if (empty($lang) || !SbLocale::isLocale($lang, true)) {
return false;
}
$locale = new SbLocale($lang);
if (!$locale instanceof SbLocale) {
return false;
}
Registry::getLocale()->setLocale($locale);
$translate = Registry::get('Zend_Translate');
if ($translate instanceof \Zend_Translate) {
$translate->setLocale($locale);
}
return true;
}
示例3: getTranslator
protected function getTranslator()
{
return Registry::get('Zend_Translate');
}
示例4: createNewWebsite
/**
* @param string|null $websiteName
*
* @return \Cms\Data\Website
* @throws \Zend_Exception
*/
protected function createNewWebsite($websiteName)
{
$translate = Registry::get('Zend_Translate');
if (!is_string($websiteName)) {
$websiteName = sprintf($translate->_('import.file.new_website_name'), $this->getImportFormattedDateTime());
}
$attributes = array('name' => $websiteName);
return $this->createWebsite($attributes);
}
示例5: updatePublisherStatusToFailed
private function updatePublisherStatusToFailed($websiteId, $buildId, PublisherStatusData &$publishedStatus, $msg = null)
{
try {
if (empty($msg) && !is_string($msg)) {
$translate = Registry::get('Zend_Translate');
$msg = $translate->_('publisher.published_status.error.status_unknown');
}
$publishedStatus->setStatus(PublisherStatusData::STATUS_FAILED);
$publishedStatus->setMsg($msg);
$this->setPublisherStatus($websiteId, $buildId, $publishedStatus);
} catch (\Exception $logOnly) {
Registry::getLogger()->log(__METHOD__, __LINE__, $logOnly->getMessage(), SbLog::ERR);
return;
}
}