本文整理汇总了PHP中RWMB_Select_Field::html方法的典型用法代码示例。如果您正苦于以下问题:PHP RWMB_Select_Field::html方法的具体用法?PHP RWMB_Select_Field::html怎么用?PHP RWMB_Select_Field::html使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RWMB_Select_Field
的用法示例。
在下文中一共展示了RWMB_Select_Field::html方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html($meta, $field)
{
$field['options'] = self::get_options($field);
switch ($field['field_type']) {
case 'select':
return RWMB_Select_Field::html($meta, $field);
case 'select_advanced':
default:
return RWMB_Select_Advanced_Field::html($meta, $field);
}
}
示例2: walk_select_tree
/**
* Walker for displaying select in tree format
*
* @param $meta
* @param $field
* @param $elements
* @param int $parent
* @param bool $active
*
* @return string
*/
static function walk_select_tree($meta, $field, $elements, $parent = 0, $active = false)
{
if (!isset($elements[$parent])) {
return;
}
$terms = $elements[$parent];
$field['options'] = self::get_options($terms);
$classes = array('rw-taxonomy-tree');
$classes[] = $active ? 'active' : 'disabled';
$classes[] = "rwmb-taxonomy-{$parent}";
$html = '<div class="' . implode(' ', $classes) . '">';
$html .= RWMB_Select_Field::html($meta, $field);
foreach ($terms as $term) {
$html .= self::walk_select_tree($meta, $field, $elements, $term->term_id, $active && in_array($term->term_id, $meta));
}
$html .= '</div>';
return $html;
}
示例3: walk_select_tree
/**
* Walker for displaying select in treeformat
*
* @param $meta
* @param $field
* @param $elements
* @param int $parent
* @param string $parent_slug
* @param bool $active
*
* @return string
*/
static function walk_select_tree($meta, $field, $elements, $parent = 0, $parent_slug = '', $active = false)
{
if (!isset($elements[$parent])) {
return;
}
$terms = $elements[$parent];
$field['options'] = self::get_options($terms);
$hidden = $active ? 'active' : 'disabled';
$disabled = disabled($active, false, false);
$id = empty($parent_slug) ? '' : " id='rwmb-taxonomy-{$parent_slug}'";
$html = "<div{$id} class='rw-taxonomy-tree {$hidden}'>";
$html .= RWMB_Select_Field::html($html, $meta, $field);
foreach ($terms as $term) {
$html .= self::walk_select_tree($meta, $field, $elements, $term->term_id, $term->slug, in_array($term->slug, $meta) && $active) . '</li>';
}
$html .= '</div>';
return $html;
}
示例4: html
/**
* Get field HTML
*
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html($meta, $field)
{
$field['options'] = self::get_options($field);
return RWMB_Select_Field::html($meta, $field);
}