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


PHP HtmlHelper::standard_tag方法代码示例

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


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

示例1: metabox_html

 /**
  * Prints the metabox markup
  * @param $post the current post
  * TODO: support for other input types and select :D
  */
 public function metabox_html($post)
 {
     wp_nonce_field($this->metaname, $this->metaname . '_nonce');
     $values = $this->get_meta($post->ID);
     $rows = '';
     foreach ($this->fields as $field) {
         $th = HtmlHelper::standard_tag('th', $field['label'], array('class' => ''));
         switch ($field['type']) {
             case 'callback':
                 $input = $this->_markup_callback($field, $values, $post);
                 break;
             case 'select':
                 $input = $this->_markup_select($field, $values);
                 break;
             case 'single-attachment':
                 $input = $this->_markup_single_attachment($field, $values);
                 break;
             case 'chebox-list':
                 $input = $this->_markup_checkbox_list($field, $values);
                 break;
             case 'checkbox':
                 $input = $this->_markup_checkbox($field, $values);
                 break;
             case 'text':
             default:
                 $input = $this->_markup_text($field, $values);
                 break;
         }
         if (!empty($field['description'])) {
             $input .= HtmlHelper::br() . HtmlHelper::paragraph($field['description'], array('class' => 'description'));
         }
         $td = HtmlHelper::standard_tag('td', $input, array('class' => ''));
         $tr = HtmlHelper::standard_tag('tr', $th . "\n" . $td);
         $rows .= $tr;
     }
     echo HtmlHelper::standard_tag('table', HtmlHelper::standard_tag('tbody', $rows), array('class' => 'form-table'));
 }
开发者ID:setola,项目名称:wordpress-theme-utils-classes,代码行数:42,代码来源:SimpleMetabox.class.php

示例2: get_markup

 public function get_markup()
 {
     $slides = '';
     $indicators = '';
     $slide_sub = new SubstitutionTemplate();
     $slide_sub->set_tpl($this->tpl_slide);
     foreach ($this->images as $k => $v) {
         $active = $k == 0 ? 'active' : '';
         $caption = '';
         $style = 'width: 100%; height: 100%; background: url(\'' . $this->get_image_src($k) . '\') no-repeat center center scroll transparent;';
         if ($this->get_image_title($k)) {
             $caption .= HtmlHelper::standard_tag('h2', $this->get_image_title($k));
         }
         if ($this->get_image_caption($k)) {
             $caption .= HtmlHelper::paragraph($this->get_image_caption($k));
         }
         $image = $slide_sub->set_markup('class', implode(' ', array('item', $active)))->set_markup('image', HtmlHelper::div('', array('alt' => $this->get_image_alt($k), 'style' => $style)))->set_markup('caption', HtmlHelper::div($caption, array('class' => 'carousel-caption')))->replace_markup();
         $indicator = HtmlHelper::list_item($inner_html, array('data-target' => '#' . $this->unid, 'data-slide-to' => $k, 'class' => $active));
         $slides .= $image . "\n";
         $indicators .= $indicator . "\n";
     }
     $subs = new SubstitutionTemplate();
     return $subs->set_tpl($this->tpl)->set_markup('id', $this->unid)->set_markup('container_classes', $this->container_classes)->set_markup('indicators', HtmlHelper::ordered_list($indicators, array('class' => 'carousel-indicators')))->set_markup('slides', HtmlHelper::div($slides, array('class' => 'carousel-inner')))->replace_markup();
 }
开发者ID:setola,项目名称:wordpress-theme-utils-classes,代码行数:24,代码来源:BootstrapCarousel.class.php

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