本文整理汇总了PHP中HtmlHelper::list_item方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlHelper::list_item方法的具体用法?PHP HtmlHelper::list_item怎么用?PHP HtmlHelper::list_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlHelper
的用法示例。
在下文中一共展示了HtmlHelper::list_item方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: list_hook
/**
* This is called back by WordPress when the tab list shortcode is found
* @param array $atts User defined attributes in shortcode tag.
*/
public function list_hook($atts)
{
$parms = shortcode_atts(array('class' => 'tabs'), $atts);
$inner_html = '';
foreach ($this->list_of_entries as $entry) {
$inner_html .= HtmlHelper::list_item(HtmlHelper::anchor('#' . sanitize_title($entry['title']), $this->get_image($entry['icon']) . $entry['title'], array('data-title' => $entry['title'], 'data-from' => $entry['from'], 'data-route-type' => $entry['route_type'])), array('class' => $entry['class']));
}
return HtmlHelper::unorderd_list($inner_html, array('class' => $parms['class']));
}