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


PHP get_default函数代码示例

本文整理汇总了PHP中get_default函数的典型用法代码示例。如果您正苦于以下问题:PHP get_default函数的具体用法?PHP get_default怎么用?PHP get_default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:35,代码来源:block.button.php

示例2: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:28,代码来源:block.faq.php

示例3: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:25,代码来源:block.slink.php

示例4: 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;
}
开发者ID:zhaoshengloveqingqing,项目名称:Website,代码行数:26,代码来源:function.alert.php

示例5: smarty_function_a

function smarty_function_a($params, $template)
{
    $uri = get_default($params, 'uri', '');
    $title = lang(get_default($params, 'title', ''));
    unset($params['uri']);
    return anchor($uri, $title, $params);
}
开发者ID:zhaoshengloveqingqing,项目名称:Website,代码行数:7,代码来源:function.a.php

示例6: smarty_function_img

function smarty_function_img($params, $template)
{
    $CI =& get_instance();
    $CI->load->helper('html');
    $attr = array();
    $src = get_default($params, 'src');
    $class = get_default($params, 'class');
    $alt = get_default($params, 'alt');
    $title = get_default($params, 'title');
    $width = get_default($params, 'width');
    $height = get_default($params, 'height');
    if ($src != '') {
        $attr['src'] = $src;
    }
    if ($class != '') {
        $attr['class'] = $class;
    }
    if ($alt != '') {
        $attr['alt'] = $alt;
    }
    if ($title != '') {
        $attr['title'] = $title;
    }
    if ($width != '') {
        $attr['width'] = $width;
    }
    if ($height != '') {
        $attr['height'] = $height;
    }
    return img($attr);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:31,代码来源:function.img.php

示例7: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:8,代码来源:block.input_group.php

示例8: get_default_array

function get_default_array($defaults)
{
    $f_get = array();
    foreach ($defaults as $n => $d) {
        $f_get[strtolower($n)] = get_default($n, $d);
    }
    return $f_get;
}
开发者ID:PLeLuron,项目名称:gl-info,代码行数:8,代码来源:index.php

示例9: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:8,代码来源:block.pinet_statebar.php

示例10: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:8,代码来源:block.listview.php

示例11: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:9,代码来源:block.table_row.php

示例12: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:9,代码来源:block.button_group.php

示例13: smarty_block_link

function smarty_block_link($params, $content = '', $template, &$repeat)
{
    if ($repeat) {
        return;
    }
    $uri = get_default($params, 'uri', '');
    unset($params['uri']);
    return anchor($uri, $content, $params);
}
开发者ID:zhaoshengloveqingqing,项目名称:Website,代码行数:9,代码来源:block.link.php

示例14: smarty_function_js

function smarty_function_js($params, $template)
{
    $position = get_default($params, 'position', 'foot');
    $CI =& get_instance();
    foreach ($CI->jsFiles as $js) {
        if ($position == $js->position) {
            echo $js->render();
        }
    }
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:10,代码来源:function.js.php

示例15: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:10,代码来源:block.col.php


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