本文整理汇总了PHP中FormHelper::choice方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHelper::choice方法的具体用法?PHP FormHelper::choice怎么用?PHP FormHelper::choice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormHelper
的用法示例。
在下文中一共展示了FormHelper::choice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render_blogfilter_active_setting
function _render_blogfilter_active_setting()
{
require_once 'AuthorAvatarsForm.class.php';
echo '<tr valign="top">';
echo '<th scope="row">' . __('Enable blog filter', 'author-avatars') . '</th><td>';
echo FormHelper::choice('settings_sitewide[blog_filters_enabled]', AuthorAvatarsForm::_getAllBlogs(), $this->settings->get_sitewide('blog_filters_enabled'), array('multiple' => true, 'label' => __('Select the blogs which you would like the blog filter to be enabled. Only blogs selected here can display users from other blogs.', 'author-avatars')));
echo '</td>';
echo '</tr>';
}
示例2: renderFieldAlignment
/**
* Renders the alignment radio fields for the show_avatar wizard
*
* @param mixed $values the field values
* @param string $name the field name
*
* @return string
*/
function renderFieldAlignment($values = '', $name = 'alignment')
{
$alignment_options = array('' => __('None', 'author-avatars'), 'left' => __('Left', 'author-avatars'), 'center' => __('Center', 'author-avatars'), 'right' => __('Right', 'author-avatars'));
$attributes = array('id' => $this->_getFieldId($name), 'label' => '<strong>' . __('Alignment', 'author-avatars') . '</strong><br/>', 'expanded' => true, 'inline' => true, 'class' => 'alignment');
$name = $this->_getFieldName($name);
return '<p>' . FormHelper::choice($name, $alignment_options, $values, $attributes) . '</p>';
}