本文整理汇总了PHP中Zend_View_Interface::getTranslation方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface::getTranslation方法的具体用法?PHP Zend_View_Interface::getTranslation怎么用?PHP Zend_View_Interface::getTranslation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Interface
的用法示例。
在下文中一共展示了Zend_View_Interface::getTranslation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectLanguage
/**
*
*/
public function selectLanguage($name, $value, $attribs = null)
{
//select version
$config = Zend_Registry::get('config');
$siteVersions = $config->language->translations;
foreach ($siteVersions as $locale => $label) {
$data[$locale] = $this->view->getTranslation($label);
}
return $this->view->formSelect($name, $value, $attribs, $data);
}
示例2: languageForm
/**
* this helper renders a language selector
* it also processes the selected language
* it must be rendered above the content in order for the current
* content to reflect the language selection
*/
public function languageForm()
{
//process form if this is a post back
if (Digitalus_Filter_Post::has('setLang')) {
Digitalus_Language::setLanguage($_POST['language']);
// @todo: this needs to redirect so it loads the whole page in the new language
}
$currentLanguage = Digitalus_Language::getLanguage();
$languageSelector = $this->view->selectLanguage('language', $currentLanguage);
$xhtml = '<form action="' . $this->view->ModuleAction() . '" method="post">';
$xhtml .= '<p>' . $languageSelector . '</p>';
$xhtml .= '<p>' . $this->view->formSubmit('setLang', $this->view->getTranslation('Set Language')) . '</p>';
$xhtml .= '</form>';
return $xhtml;
}
示例3: selectBlog
/**
*
*/
public function selectBlog($name, $value)
{
$mdlBlog = new Blog_Blog();
$blogs = $mdlBlog->getBlogs();
if ($blogs == null) {
return $this->view->getTranslation('There are no blogs to view!');
} else {
$options[] = $this->view->getTranslation('Select One');
foreach ($blogs as $blog) {
$options[$blog->id] = $blog->name;
}
$form = new Digitalus_Form();
$select = $form->createElement('select', $name, array('multiOptions' => $options, 'belongsTo' => 'module'));
return $select;
}
}
示例4: selectLayout
/**
*
*/
public function selectLayout($name, $value = null, $attr = null, $defaut = null)
{
$config = Zend_Registry::get('config');
$pathToPublicLayouts = $config->design->pathToPublicLayouts;
$layouts = Digitalus_Filesystem_File::getFilesByType($pathToPublicLayouts, 'phtml');
if ($defaut == NULL) {
$defaut = $this->view->getTranslation('Select One');
}
$options[0] = $defaut;
if (is_array($layouts)) {
foreach ($layouts as $layout) {
$options[$layout] = $layout;
}
return $this->view->formSelect($name, $value, $attr, $options);
} else {
return null;
}
}
示例5: selectSkin
/**
*
*/
public function selectSkin($name, $value = null, $attr = null, $defaut = null)
{
$config = Zend_Registry::get('config');
$pathToPublicSkins = $config->design->pathToSkins;
$skins = Digitalus_Filesystem_Dir::getDirectories($pathToPublicSkins);
if ($defaut == NULL) {
$defaut = $this->view->getTranslation('Select One');
}
$options[0] = $defaut;
if (is_array($skins)) {
foreach ($skins as $skin) {
$options[$skin] = $skin;
}
return $this->view->formSelect($name, $value, $attr, $options);
} else {
return null;
}
}
示例6: listLanguageLinks
/**
*
*/
public function listLanguageLinks()
{
$page = Digitalus_Builder::getPage();
$currentLanguage = $page->getLanguage();
$availableLanguages = $page->getAvailableLanguages();
$xhtml = $this->view->getTranslation('You are reading this page in') . ' ' . $this->view->getTranslation(Digitalus_Language::getFullName($currentLanguage)) . '.';
if (is_array($availableLanguages)) {
$languageLinks = array();
$uri = new Digitalus_Uri();
$base = $uri->toString();
foreach ($availableLanguages as $locale => $name) {
if (!empty($locale) && $locale != $currentLanguage) {
$url = $base . '/p/language/' . $locale;
$languageLinks[] = '<a href="' . $url . '">' . $this->view->getTranslation($name) . '</a>';
}
}
if (is_array($languageLinks) && count($languageLinks) > 0) {
foreach ($languageLinks as $language) {
$languageLinksTranslated[] = $this->view->getTranslation($language);
}
$xhtml .= ' ' . $this->view->getTranslation('This page is also translated into') . ' ' . implode(', ', $languageLinks);
}
}
return '<p>' . $xhtml . '</p>';
}
示例7: link
/**
*
*/
public function link($label, $link, $icon = null, $class = 'link', $target = null)
{
$this->link = Digitalus_Toolbox_String::stripLeading('/', $link);
$this->baseUrl = Digitalus_Toolbox_String::stripLeading('/', $this->view->getBaseUrl());
// clean the link
if ($this->isRemoteLink($link) || $this->isAnchorLink($link)) {
$cleanLink = $link;
} else {
$cleanLink = '/' . $this->addBaseUrl($this->link);
}
if ($target != null) {
$target = "target='{$target}'";
}
$linkParts[] = "<a href='{$cleanLink}' class='{$class}' {$target}>";
if (null !== $icon) {
$linkParts[] = $this->getIcon($icon, $label);
}
if (!empty($label)) {
$linkParts[] = $this->view->getTranslation((string) $label);
}
$linkParts[] = '</a>';
return implode(null, $linkParts);
}