当前位置: 首页>>代码示例>>PHP>>正文


PHP HtmlHelper::span方法代码示例

本文整理汇总了PHP中HtmlHelper::span方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlHelper::span方法的具体用法?PHP HtmlHelper::span怎么用?PHP HtmlHelper::span使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlHelper的用法示例。


在下文中一共展示了HtmlHelper::span方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: metabox_html

 /**
  * Prints the HTML markup for the metabox
  */
 public static function metabox_html($post)
 {
     if (is_null($post)) {
         global $post;
     }
     $template = self::get_template($post);
     if (count(self::$media_list)) {
         $is_first = true;
         foreach (self::$media_list as $k => $elem) {
             $template_checker = new TemplateChecker($elem['include'], $elem['exclude']);
             if (!$template_checker->check($template)) {
                 continue;
             }
             $name = self::META_KEY_NAME . '-' . $elem['id'];
             wp_nonce_field(__FILE__, $name . '_nonce');
             $value = get_post_meta($post->ID, $name, true);
             // main edit button
             $edit_button = HtmlHelper::anchor('javascript:;', HtmlHelper::span('', array('class' => 'wp-media-buttons-icon')) . __('Manage Media', 'wtu_framework'), array('id' => 'wtu-media-manager-button-' . $elem['id'], 'class' => 'button media-manager-button', 'data-target' => '#wtu-media-manager-element-' . $elem['id'], 'data-target-undo' => '#wtu-media-manager-undo-' . $elem['id'], 'data-target-delete' => '#wtu-media-manager-delete-' . $elem['id'], 'data-counter' => '#wtu-media-manager-counter-' . $elem['id'], 'data-frame-id' => 'wtu-media-manager-' . $elem['id'], 'data-title' => sprintf(__('Manage Media for %s', 'wtu_framework'), $elem['label']), 'data-button-label' => sprintf(__('Add selected media to %s set', 'wtu_framework'), $elem['label']), 'data-multiple' => 'true', 'data-elem-id' => $elem['id'], 'data-shortcode' => $elem['shortcode'], 'title' => sprintf(__('Manage Media for %s', 'wtu_framework'), $elem['label'])));
             // input to store temp values, use text instead of hidden to debug
             $input = HtmlHelper::input($name, 'hidden', array('id' => 'wtu-media-manager-element-' . $elem['id'], 'value' => $value));
             // Counter
             $number = 0;
             if (isset($value) && $value != '') {
                 $number = count(explode(',', $value));
             }
             $counter = ' ' . HtmlHelper::span($number > 0 ? sprintf(_n('1 element', '%s elements', $number, 'wtu_framework'), $number) : __('Empty', 'wtu_framework'), array('id' => 'wtu-media-manager-counter-' . $elem['id'], 'data-label-no-images' => __('Empty', 'wtu_framework'), 'data-label-one-image' => __('1 element', 'wtu_framework'), 'data-label-more-images' => __('%s elements', 'wtu_framework')));
             // delete button
             $delete = HtmlHelper::anchor('javascript:;', __('Delete', 'wtu_framework'), array('id' => 'wtu-media-manager-delete-' . $elem['id'], 'style' => $value ? '' : 'display:none;', 'class' => 'delete-media-manager-gallery submitdelete', 'data-counter' => '#wtu-media-manager-counter-' . $elem['id'], 'data-gallery' => $elem['id'], 'data-target' => '#wtu-media-manager-element-' . $elem['id'], 'data-target-undo' => '#wtu-media-manager-undo-' . $elem['id'], 'data-target-origin' => '#wtu-media-manager-button-' . $elem['id'], 'title' => __('Delete Media Set', 'wtu_framework')));
             // undo button
             $undo = HtmlHelper::anchor('javascript:;', __('Undo', 'wtu_framework'), array('id' => 'wtu-media-manager-undo-' . $elem['id'], 'style' => 'display:none;', 'class' => 'undo-media-manager-gallery', 'data-gallery' => $elem['id'], 'data-target' => '#wtu-media-manager-element-' . $elem['id'], 'data-elem-id' => $elem['id'], 'data-target-origin' => '#wtu-media-manager-button-' . $elem['id'], 'data-target-delete' => '#wtu-media-manager-delete-' . $elem['id'], 'data-counter' => '#wtu-media-manager-counter-' . $elem['id'], 'title' => __('Restore Media Set', 'wtu_framework')));
             $title = HtmlHelper::paragraph(HtmlHelper::strong($elem['label']));
             $inner_html = '';
             if (!$is_first) {
                 $inner_html .= HtmlHelper::br();
             }
             $inner_html .= '<table class="widefat"><thead>';
             $inner_html .= '<td width="33%">' . $title . '</td>';
             $inner_html .= '<td width="33%">&nbsp;</td>';
             $inner_html .= '<td width="33%">' . $edit_button . '</td></thead>';
             $inner_html .= '<tbody><tr style="line-height: 25px;"><td class="submitbox">' . $delete . $undo . '</td>';
             $inner_html .= '<td>&nbsp;</td>';
             $inner_html .= '<td>' . $counter . '</td>';
             $inner_html .= '</tr></tbody></table>';
             $inner_html .= $input;
             echo HtmlHelper::div($inner_html, array('class' => ''));
             $is_first = false;
         }
     }
     //var_dump($value);
 }
开发者ID:setola,项目名称:wordpress-theme-utils-classes,代码行数:53,代码来源:MediaManager.class.php

示例2: image

 /**
  * Returns the markup for an adaptive image
  * @param int $attachment_id the iamge id
  * @param string $size the image size
  * @param array $attr img tag attributes
  * @return string html merkup
  */
 public function image($attachment_id, $size, $attr = array())
 {
     $default_attr = self::get_image($attachment_id, $size);
     @($attr['class'] = $default_attr['class'] . ' responsive-image-placeholder ' . $attr['class']);
     return HtmlHelper::span('', $default_attr) . HtmlHelper::standard_tag('noscript', wp_get_attachment_image($imageid, $size, false, $attr));
 }
开发者ID:setola,项目名称:wordpress-theme-utils-classes,代码行数:13,代码来源:ResponsiveImagesManager.class.php


注:本文中的HtmlHelper::span方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。