本文整理汇总了PHP中get_default函数的典型用法代码示例。如果您正苦于以下问题:PHP get_default函数的具体用法?PHP get_default怎么用?PHP get_default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_default函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:11,代码来源:function.label.php
示例17: 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(), '');
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:11,代码来源:function.icon.php
示例18: show_page
function show_page($page)
{
$template = "view/templates/default_template.php";
if (file_exists($template) && is_file($template)) {
require_once $template;
} else {
require_once "view/templates/default_template.php";
}
echo get_document_head();
echo get_header_start();
if (is_logged_in()) {
echo get_logout();
} else {
}
echo get_header_end();
if (is_logged_in()) {
echo get_menu();
} else {
echo get_guest_menu();
}
if (is_logged_in()) {
if ($page == "startpage") {
echo "startpage";
} else {
if ($page == "fileupload") {
echo get_fileupload();
} else {
if ($page == "nyheter") {
echo get_news();
} else {
if ($page == "flowing") {
echo get_flowing();
} else {
if ($page == "event") {
echo get_event();
} else {
if ($page == "profile") {
$user_id = 1;
echo get_profile($user_id);
} else {
echo get_default("");
}
}
}
}
}
}
} else {
echo get_login();
}
echo get_footer();
echo get_document_end();
}
开发者ID:eva-chaunm,项目名称:paraflow,代码行数:53,代码来源:page.php
示例19: smarty_function_banner
function smarty_function_banner($params, $template)
{
$src = get_default($params, 'src', null);
if ($src == null) {
return '';
}
$height = get_default($params, 'height', null);
if ($height != null) {
$params['style'] .= 'height:' . $height . ';';
}
return Clips\create_tag('div', $params, array('class' => 'pinet_banner'), '');
}
开发者ID:guitarpoet,项目名称:clips-tool,代码行数:12,代码来源:function.banner.php
示例20: 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);
}
开发者ID:zhaoshengloveqingqing,项目名称:Ci,代码行数:13,代码来源:block.radio_group.php
注:本文中的get_default函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论