当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_View_Interface::getTranslation方法代码示例

本文整理汇总了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);
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:13,代码来源:SelectLanguage.php

示例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;
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:21,代码来源:LanguageForm.php

示例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;
     }
 }
开发者ID:laiello,项目名称:digitalus-cms,代码行数:19,代码来源:SelectBlog.php

示例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;
     }
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:21,代码来源:SelectLayout.php

示例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;
     }
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:21,代码来源:SelectSkin.php

示例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>';
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:28,代码来源:ListLanguageLinks.php

示例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);
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:26,代码来源:Link.php


注:本文中的Zend_View_Interface::getTranslation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。