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


PHP PhpRenderer::formSelect方法代碼示例

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


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

示例1: form

 public function form(PhpRenderer $view)
 {
     // Normalize vocab terms for use in a select element.
     $terms = array_map('trim', explode(PHP_EOL, $this->vocab->terms()));
     $valueOptions = array_combine($terms, $terms);
     $select = new Select('customvocab');
     $select->setAttributes(['class' => 'terms to-require', 'data-value-key' => '@value'])->setEmptyOption('Select Below')->setValueOptions($valueOptions);
     return $view->formSelect($select);
 }
開發者ID:omeka-s-modules,項目名稱:CustomVocab,代碼行數:9,代碼來源:CustomVocab.php

示例2: thumbnailTypeSelect

 /**
  * Return a thumbnail type select element.
  *
  * @param PhpRenderer $view
  * @param SiteRepresentation $site
  * @param SiteBlockAttachmentRepresentation|null $block
  * @return string
  */
 public function thumbnailTypeSelect(PhpRenderer $view, SiteRepresentation $site, SitePageBlockRepresentation $block = null)
 {
     $types = $this->getServiceLocator()->get('Omeka\\File\\Manager')->getThumbnailTypes();
     $type = null;
     if ($block) {
         $type = $this->getData($block->data(), 'thumbnail_type');
     }
     $select = new Select('o:block[__blockIndex__][o:data][thumbnail_type]');
     $select->setValueOptions(array_combine($types, $types))->setValue($type);
     return '<label class="thumbnail-option">Thumbnail Type ' . $view->formSelect($select) . '</label>';
 }
開發者ID:patrova,項目名稱:omeka-s,代碼行數:19,代碼來源:AbstractBlockLayout.php

示例3: getTemplate

 public function getTemplate(PhpRenderer $view)
 {
     // Normalize vocab terms for use in a select element.
     $terms = array_map('trim', explode(PHP_EOL, $this->vocab->terms()));
     $valueOptions = array_combine($terms, $terms);
     $hidden = new Hidden('customvocab');
     $hidden->setAttributes(['class' => 'language'])->setValue($this->vocab->lang());
     $select = new Select('customvocab');
     $select->setAttributes(['class' => 'terms'])->setEmptyOption('Select Below')->setValueOptions($valueOptions);
     return $view->formHidden($hidden) . $view->formSelect($select);
 }
開發者ID:jimsafley,項目名稱:CustomVocab,代碼行數:11,代碼來源:CustomVocab.php


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