本文整理汇总了PHP中PodsForm::attributes方法的典型用法代码示例。如果您正苦于以下问题:PHP PodsForm::attributes方法的具体用法?PHP PodsForm::attributes怎么用?PHP PodsForm::attributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PodsForm
的用法示例。
在下文中一共展示了PodsForm::attributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$type = 'textarea';
$attributes = array();
$attributes['tabindex'] = 2;
$attributes = PodsForm::merge_attributes($attributes, $name, $form_field_type, $options);
if (pods_var('readonly', $options, false)) {
$attributes['readonly'] = 'READONLY';
$attributes['class'] .= ' pods-form-ui-read-only';
}
?>
<textarea<?php
PodsForm::attributes($attributes, $name, $form_field_type, $options);
?>
><?php
echo esc_textarea($value);
?>
</textarea>
<?php
PodsForm::regex($form_field_type, $options);
示例2: elseif
$plupload_init['filters'][0]['extensions'] = $limit_types;
}
if (is_admin() && !empty($post_ID)) {
$plupload_init['multipart_params']['post_id'] = (int) $post_ID;
} elseif (is_object($pod) && in_array($pod->pod_data['type'], array('post_type', 'media')) && 0 < $id) {
$plupload_init['multipart_params']['post_id'] = (int) $id;
}
$plupload_init = apply_filters('plupload_init', $plupload_init);
if (empty($value)) {
$value = array();
} else {
$value = (array) $value;
}
?>
<div<?php
PodsForm::attributes(array('class' => $attributes['class'], 'id' => $attributes['id']), $name, $form_field_type, $options);
?>
>
<ul class="pods-files pods-files-list"><?php
// no extra space in ul or CSS:empty won't work
foreach ($value as $val) {
$attachment = get_post($val);
if (empty($attachment)) {
continue;
}
$thumb = wp_get_attachment_image_src($val, 'thumbnail', true);
$title = $attachment->post_title;
if (0 == $title_editable) {
$title = basename($attachment->guid);
}
echo $field_file->markup($attributes, $file_limit, $title_editable, $val, $thumb[0], $title);
示例3:
<label<?php
PodsForm::attributes($attributes, $name, 'label');
?>
>
<?php
echo $label;
if (1 == pods_var('required', $options, pods_var('options', $options, $options))) {
echo ' <abbr title="required" class="required">*</abbr>';
}
if (0 == pods_var('grouped', $options, 0, null, true) && !empty($help) && 'help' != $help) {
pods_help($help);
}
?>
</label>
示例4:
<?php
} else {
$option_label = (string) $option_label;
$selected = '';
$options['selected'] = '';
if (!$selection_made && (!is_array($value) && (string) $option_value === (string) $value || is_array($value) && (in_array($option_value, $value) || in_array((string) $option_value, $value)))) {
$selected = ' SELECTED';
$options['selected'] = 'selected';
if (!$multiple) {
$selection_made = true;
}
}
if (is_array($option_value)) {
?>
<option<?php
PodsForm::attributes($option_value, $name, $form_field_type . '_option', $options);
?>
><?php
echo esc_html($option_label);
?>
</option>
<?php
} else {
?>
<option value="<?php
echo esc_attr($option_value);
?>
"<?php
echo $selected;
?>
><?php
示例5:
<p<?php
PodsForm::attributes($attributes, $name, $type, $options);
?>
>
<?php
echo $message;
?>
</p>