本文整理汇总了PHP中RWMB_Field::render_attributes方法的典型用法代码示例。如果您正苦于以下问题:PHP RWMB_Field::render_attributes方法的具体用法?PHP RWMB_Field::render_attributes怎么用?PHP RWMB_Field::render_attributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RWMB_Field
的用法示例。
在下文中一共展示了RWMB_Field::render_attributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start_el
/**
* @see Walker::start_el()
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $object Item data object.
* @param int $depth Depth of item.
* @param int $current_object_id Item ID.
* @param array $args
*/
public function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
{
$label = $this->db_fields['label'];
$id = $this->db_fields['id'];
$attributes = RWMB_Field::call('get_attributes', $this->field, $object->{$id});
$output .= sprintf('<li><label><input %s %s>%s</label>', RWMB_Field::render_attributes($attributes), checked(in_array($object->{$id}, $this->meta), 1, false), $object->{$label});
}
示例2: start_el
/**
* @see Walker::start_el()
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $object Item data object.
* @param int $depth Depth of item.
* @param int $current_object_id Item ID.
* @param array $args
*/
public function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
{
$label = $this->db_fields['label'];
$id = $this->db_fields['id'];
$meta = $this->meta;
$field = $this->field;
$field_class = RW_Meta_Box::get_class_name($field);
$attributes = call_user_func(array($field_class, 'get_attributes'), $field, $object->{$id});
$output .= sprintf('<li><label><input %s %s>%s</label>', RWMB_Field::render_attributes($attributes), checked(in_array($object->{$id}, $meta), 1, false), $object->{$label});
}
示例3: display_level
function display_level($options, $parent_id = 0, $active = false)
{
$id = $this->db_fields['id'];
$field = $this->field;
$walker = new RWMB_Walker_Select($this->db_fields, $field, $this->meta);
$attributes = RWMB_Field::call('get_attributes', $field, $this->meta);
$children = $options[$parent_id];
$output = sprintf('<div class="rwmb-select-tree %s" data-parent-id="%s"><select %s>', $active ? '' : 'hidden', $parent_id, RWMB_Field::render_attributes($attributes));
$output .= isset($field['placeholder']) ? "<option value=''>{$field['placeholder']}</option>" : '<option></option>';
$output .= $walker->walk($children, -1);
$output .= '</select>';
foreach ($children as $c) {
if (isset($options[$c->{$id}])) {
$output .= $this->display_level($options, $c->{$id}, in_array($c->{$id}, $this->meta) && $active);
}
}
$output .= '</div>';
return $output;
}