本文整理汇总了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);
}
示例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>';
}
示例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);
}