本文整理匯總了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>';
}