本文整理汇总了PHP中create_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP create_tag函数的具体用法?PHP create_tag怎么用?PHP create_tag使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_alert
function smarty_function_alert($params, $template)
{
$CI =& get_instance();
$ret = array();
ci_log('The alerts is ', $CI->getAlerts());
$origin_class = get_default($params, 'class');
foreach ($CI->getAlerts() as $alert) {
$classes = make_classes($origin_class, 'alert');
$classes[] = 'pinet-alert-' . $alert->type;
$classes[] = 'alert-map-item';
$params['class'] = $classes;
$yes_btn = create_tag('button', array('class' => array('btn', 'pinet-alert-btn-default', 'yes')), array(), 'YES');
$no_btn = create_tag('button', array('class' => array('btn', 'pinet-alert-btn-default', 'no')), array(), 'NO');
$content = $yes_btn . $no_btn;
$menu = create_tag('div', array('class' => array('menu')), array(), $content);
$info = create_tag('div', array('class' => 'info'), array(), $alert->message);
$alert_inner = $menu . $info;
$ret[] = create_tag('div', $params, array('role' => 'alert'), $alert_inner);
}
$CI->clearAlerts();
$alerts = '';
if ($ret) {
$alerts = create_tag('div', array('class' => 'pinet-alert-map'), array(), implode("\n", $ret));
}
return $alerts;
}
示例2: smarty_function_closebutton
function smarty_function_closebutton($params, $template)
{
$span = create_tag("span", array("aria-hidden" => true), array(), '×');
$sr_only_span = create_tag("span", array("class" => "sr-only"), array(), 'close');
$content = $span . $sr_only_span;
return create_tag('button', array('class' => 'close'), array(), $content);
}
示例3: pinet_smarty_create_button
function pinet_smarty_create_button($params, $content = '')
{
$tag = get_default($params, 'tag', 'button');
if (isset($params['tag'])) {
unset($params['tag']);
}
$show = get_default($params, 'show', 'default');
if (isset($params['show'])) {
unset($params['show']);
}
if ($tag == 'input' && !isset($params['type'])) {
$params['type'] = 'button';
}
$params['class'] = make_classes('btn', 'pinet-btn', 'btn-' . $show, get_default($params, 'class', null));
if ($tag == 'input' && !isset($params['value'])) {
$params['value'] = $content;
}
$params['role'] = 'button';
if (!isset($params['title'])) {
$params['title'] = trim(strip_tags($content));
}
if (isset($params['icon']) && $params['icon'] != '') {
$iconName = $params['icon'];
unset($params['icon']);
$iconParams = array();
$iconParams['class'] = make_classes('glyphicon', 'glyphicon-' . $iconName);
$iconParams['aria-hidden'] = 'true';
$icon = create_tag('span', $iconParams, array(), '');
$content = $icon . $content;
}
if ($tag == 'input') {
return create_tag('input', $params, array());
}
return create_tag($tag, $params, array(), $content);
}
示例4: smarty_block_slink
function smarty_block_slink($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$href = get_default($params, 'href', null);
if (isset($params['uri']) && $params['uri'] != '') {
$uri = $params['uri'];
$params['href'] = site_url($uri);
} else {
if (isset($params['uri']) && $params['uri'] == '') {
$uri = $params['uri'];
$params['href'] = '';
} else {
if ($href == '') {
trigger_error('must need href attribute');
} else {
$params['href'] = $href;
}
}
}
unset($params['uri']);
$params['href'] = lang($href);
return create_tag('a', $params, array(), $content);
}
示例5: smarty_block_faq
function smarty_block_faq($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$tag = get_default($params, 'tag', 'span');
if (isset($params['tag'])) {
unset($params['tag']);
}
$placement = get_default($params, 'placement', 'bottom');
$params["data-placement"] = $placement;
if (isset($params['placement'])) {
unset($params['placement']);
}
$auto = get_default($params, 'auto', true);
if ($auto) {
$params['data-toggle'] = 'tooltip';
}
if (isset($params['auto'])) {
unset($params['auto']);
}
$show = get_default($params, 'show', 'default');
$params['class'] = make_classes('faq', 'faq-' . $show, get_default($params, 'class', null));
if (!isset($params['title'])) {
$params['title'] = trim(strip_tags($content));
}
return create_tag($tag, $params, array(), $content);
}
示例6: smarty_block_input_group
function smarty_block_input_group($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$params['class'] = make_classes('input-group', get_default($params, 'class', null));
return create_tag('div', $params, array(), $content);
}
示例7: smarty_block_pinet_statebar
function smarty_block_pinet_statebar($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$params['class'] = make_classes(array('pinet-statebar'), get_default($params, 'class', array()));
return create_tag('div', $params, array(), $content);
}
示例8: smarty_block_listview
function smarty_block_listview($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$attr = array('id' => 'listview', 'class' => make_classes(array('listview', 'display'), get_default($params, 'class', array())));
return create_tag('ul', $attr, array(), $content);
}
示例9: smarty_block_button_group
function smarty_block_button_group($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$params['data-toggle'] = 'buttons';
$params['class'] = make_classes('btn-group', get_default($params, 'class', ''));
return create_tag('div', $params, array(), $content);
}
示例10: smarty_block_table_row
function smarty_block_table_row($params, $content, $template, &$repeat)
{
if ($repeat) {
// Skip the first time
return;
}
$params['class'] = make_classes('table-row', get_default($params, 'class', null));
return create_tag('div', $params, array(), $content);
}
示例11: smarty_block_col
function smarty_block_col($params, $content, $template, &$repeat)
{
if ($repeat) {
// Skip the first time
return;
}
$col = create_tag('div', array('class' => 'scroll'), array(), $content);
$params['class'] = make_classes('col', get_default($params, 'class', null));
return create_tag('div', $params, array(), $col);
}
示例12: smarty_function_label
function smarty_function_label($params, $template)
{
if (isset($template->block_data)) {
$f = $template->block_data;
$field = $f->name;
$params['for'] = $f->getId();
$params['class'] = make_classes(get_default($params, 'class'), 'control-label');
return create_tag('label', $params, array(), $f->label);
}
return create_tag('label', $params);
}
示例13: smarty_function_icon
function smarty_function_icon($params, $template)
{
$type = get_default($params, 'type');
$tag = get_default($params, 'tag', 'i');
if (isset($params['tag'])) {
unset($params['tag']);
}
$params['class'] = make_classes('glyphicon', 'glyphicon-' . $type, get_default($params, 'class', null));
$params['aria-hidden'] = 'true';
return create_tag($tag, $params, array(), '');
}
示例14: smarty_block_radio_group
function smarty_block_radio_group($params, $content = '', $template, &$repeat)
{
if ($repeat) {
return;
}
$params['data-toggle'] = 'buttons';
$show = get_default($params, 'show', 'default');
if (isset($params['show'])) {
unset($params['show']);
}
$params['class'] = make_classes('btn-group pinet-radio-group btn-group-' . $show, get_default($params, 'class', ''));
return create_tag('div', $params, array(), $content);
}
示例15: smarty_function_textarea
function smarty_function_textarea($params, $template)
{
$CI =& get_instance();
$attr = get_attr($params, $template);
$value = $attr['value'];
if (isset($template->block_data)) {
$f = $template->block_data;
}
if ($f->state == 'readonly') {
return create_tag('div', array('class' => array('form-element', 'textarea', 'readonly')), array(), $value);
}
return form_textarea($attr, $value);
}