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


PHP li函数代码示例

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


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

示例1: to_html

 /** Convert value to HTML parseable format
  * @param mixed $value
  * @return string
  */
 public static function to_html(\System\Template\Renderer $ren, $value)
 {
     if (is_object($value) && method_exists($value, 'to_html')) {
         return $value->to_html($ren);
     }
     if (is_array($value)) {
         $content = array();
         foreach ($value as $val) {
             $content[] = li(self::to_html($ren, $val));
         }
         return ul('plain inline', $content);
     }
     if ($value instanceof \DateTime) {
         return $ren->format_date($value, 'human');
     }
     if (gettype($value) == 'boolean') {
         return span($value = $value ? 'yes' : 'no', $ren->trans($value));
     }
     if (gettype($value) == 'float') {
         return number_format($value, 5);
     }
     if (gettype($value) == 'string') {
         return htmlspecialchars_decode($value);
     }
     return $value;
 }
开发者ID:just-paja,项目名称:fudjan,代码行数:30,代码来源:template.php

示例2: ul

function ul($array)
{
    $string = begin_ul();
    foreach ($array as $item) {
        $string .= li($item);
    }
    return $string . end_ul();
}
开发者ID:vishald13,项目名称:aheadzen,代码行数:8,代码来源:DisplayHelper.php

示例3: draw

 static function draw($r)
 {
     foreach ($r as $k => $v) {
         if ($v['txt']) {
             $ret .= li($k . ') ' . stripslashes_b($v['txt']));
         }
         if ($v['r']) {
             $ret .= ul(self::draw($v['r']));
         }
     }
     return ul($ret);
 }
开发者ID:philum,项目名称:cms,代码行数:12,代码来源:slides.php

示例4: trick_names_ul

function trick_names_ul($tricks)
{
    if (count($tricks) > 0) {
        $content = '';
        foreach ($tricks as $trick) {
            $content .= li(trick_link($trick['name']));
        }
        $content = ul($content);
    } else {
        $content = 'you have no tricks';
    }
    return $content;
}
开发者ID:doodzik,项目名称:homespot_legacy,代码行数:13,代码来源:trick_html.php

示例5: tag_ids_checkbox_ul

function tag_ids_checkbox_ul($tags, $tag_defaults = array())
{
    if (count($tags) > 0) {
        $content = '';
        foreach ($tags as $tag) {
            $default = count($tag_defaults) > 0 ? in_array($tag['tag_id'], $tag_defaults) : false;
            $content .= li(checkbox_array('tag_ids', $tag['tag_id'], $default) . ' --- ' . tag_link($tag['name']));
        }
        $content = ul($content);
        return $content;
    } else {
        return false;
    }
}
开发者ID:doodzik,项目名称:homespot_legacy,代码行数:14,代码来源:tag_html.php

示例6: bullet

function bullet($u, $tp)
{
    global $bullet;
    foreach ($u as $v) {
        if (isIn($v, $bullet)) {
            $t = $v;
            $u = _drw($u)->remove($v)->O;
            break;
        }
    }
    $c = cEle($tp, array('type' => isset($t) ? $t : null));
    foreach ($u as $v) {
        $a = isStr($v) || isDrw($v) ? li($v) : $v;
        $c->addChild($a);
    }
    return $c;
}
开发者ID:hoangsoft90,项目名称:hw-hoangweb-plugin,代码行数:17,代码来源:hphp.plugin_Element.php

示例7: plug_menu

function plug_menu($d, $p, $o, $dr)
{
    if ($dr) {
        $dr = '/' . $dr;
    }
    //$ret.=li(lien('txtsmall','/plug/index',picto('phi')));
    $ret .= popbub('plug', 'plugin', picto('phi2'), 'd', 1);
    //$ret.=llj('','popup_plup___plug_plug*slct',picto('list'));
    $ret .= li(lkc('txtsmall', host() . '/plug/' . $d . ($p ? '/' . $p : '' . ($o ? '/' . $o : '')), picto('reload')));
    $ret .= li(call_plug('txtsmall', 'popup', 'codeview', 'plug' . $dr . '_' . ajx($d), picto('conn')));
    //source
    if (auth(3)) {
        $ret .= msqlink('system', 'program_plugs') . ' ';
    }
    $ret .= plug_hlp($d);
    if (auth(4)) {
        $ret .= lj('', 'popup_editmsql___system/program*plugs_' . ajx($d) . '__1', picto('edit')) . ' ';
        $ret .= lj('', 'popup_editmsql___lang/fr/program*plugs_' . ajx($d) . '__1', picto('flag')) . ' ';
    }
    return mkbub($ret, 'inline', '', 'this.style.zIndex=popz+1;') . divc('admnu', '');
}
开发者ID:philum,项目名称:cms,代码行数:21,代码来源:plug.php

示例8: table

function table($rows, $attr = array(), $titles = '')
{
    if (!is_array($rows)) {
        throw new Exception("Table must be an array");
    } else {
        if (!is_array($rows[0])) {
            if (is_object($rows[0])) {
                foreach ($rows as $row) {
                    $row = (array) $row;
                }
            } else {
                echo li('ul', $rows, $attr);
                return;
            }
        }
    }
    echo "<table ";
    foreach ($attr as $a => $b) {
        echo "{$a} = \"{$b}\" ";
    }
    echo ">";
    if (!empty($titles)) {
        echo "<thead>";
        foreach ($titles as $title) {
            echo "<th>{$title}</th>";
        }
        echo "</thead>";
    }
    foreach ($rows as $row) {
        echo "<tr>";
        foreach ($row as $field) {
            echo "<td>{$field}</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
}
开发者ID:jacovc86,项目名称:MaaseHoshev,代码行数:37,代码来源:htmlextended_helper.php

示例9: li

li(field_data_if_set($document, 'outing_length', array('suffix' => 'kilometers')));
if ($document->get('geom_wkt')) {
    li(field_export($document->get('module'), $sf_params->get('id'), $sf_params->get('lang'), $sf_params->get('version')));
}
li(field_bool_data($document, 'outing_with_public_transportation', array('show_only_yes' => true)));
$access_elevation = field_data_if_set($document, 'access_elevation', array('suffix' => 'meters'));
if (empty($access_elevation)) {
    li(field_data_from_list_if_set($document, 'access_status', 'mod_outings_access_statuses_list'));
} else {
    $access_status = field_data_from_list_if_set($document, 'access_status', 'mod_outings_access_statuses_list', array('raw' => true, 'prefix' => ' - '));
    li($access_elevation . $access_status);
}
if (array_intersect(array(1, 2, 5), $activities)) {
    li(field_data_range_if_set($document, 'up_snow_elevation', 'down_snow_elevation', array('separator' => 'elevation separator', 'suffix' => 'meters')));
}
?>
</ul>
<ul class="data col col_33">
    <li style="display:none"></li>
    <?php 
li(field_data_from_list_if_set($document, 'conditions_status', 'mod_outings_conditions_statuses_list'));
li(field_data_from_list_if_set($document, 'glacier_status', 'mod_outings_glacier_statuses_list'));
if (array_intersect(array(1, 2, 5), $activities)) {
    li(field_data_from_list_if_set($document, 'track_status', 'mod_outings_track_statuses_list'));
}
li(field_data_from_list_if_set($document, 'frequentation_status', 'mod_outings_frequentation_statuses_list'));
li(field_data_from_list_if_set($document, 'hut_status', 'mod_outings_hut_statuses_list'));
li(field_data_from_list_if_set($document, 'lift_status', 'mod_outings_lift_statuses_list'));
?>
</ul>
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:30,代码来源:_data.php

示例10: as_string

 function as_string()
 {
     $o = array();
     end($this->children);
     $lastkey = key($this->children);
     foreach ($this->children as $key => $node) {
         if (is_object($node)) {
             $t = array_pop($o);
             $r = $node->as_string();
             $this->last_node = $r;
             $o[] = $t . " " . $r;
         } else {
             $e = $this->environment();
             $handlers = $e->inline_markup_handlers();
             $t = $handlers->run($node);
             $this->last_node = $t;
             if (!$key == $lastkey) {
                 num_ref($this->last_node, $this->environment->uniq);
                 if (WIKI_REPLY) {
                     $this->environment->reply_link($this->last_node);
                 }
             }
             $o[] = $t;
             //$o[] = wiki_render_simple($node);
         }
     }
     if (count($o)) {
         $r = '';
         foreach ($o as $v) {
             $r .= li($v) . "\n";
         }
         $sum = num_ref($this->last_node, $this->environment->uniq);
         if (isset($this->environment->notifies[$sum])) {
             $u = call_user_func($this->environment->notifies[$sum], $this->last_node);
         } else {
             $u = '';
         }
         if (WIKI_REPLY) {
             return ul($r) . $u . $this->environment->reply_link($this->last_node);
         } else {
             return ul($r) . $u;
         }
     } else {
         return '';
     }
 }
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:46,代码来源:render.php

示例11: li

    }
    li(field_data_from_list_if_set($document, 'rock_exposition_rating', 'app_routes_rock_exposition_ratings'));
    li(field_data_from_list_if_set($document, 'aid_rating', 'app_routes_aid_ratings'));
    li(field_data_range_from_list_if_set($document, 'rock_free_rating', 'rock_required_rating', 'app_routes_rock_free_ratings', array('name_if_equal' => 'rock_free_and_required_rating', 'separator' => 'rock rating separator', 'suffix' => $suffix)));
}
if (array_intersect(array(2, 5), $activities)) {
    li(field_data_from_list_if_set($document, 'ice_rating', 'app_routes_ice_ratings'));
    li(field_data_from_list_if_set($document, 'mixed_rating', 'app_routes_mixed_ratings'));
}
if (in_array(1, $activities)) {
    li(field_data_from_list($document, 'toponeige_technical_rating', 'app_routes_toponeige_technical_ratings'), array('class' => 'separator'));
    li(field_data_from_list($document, 'toponeige_exposition_rating', 'app_routes_toponeige_exposition_ratings'));
    li(field_data_from_list($document, 'labande_ski_rating', 'app_routes_labande_ski_ratings'));
    li(field_data_from_list($document, 'labande_global_rating', 'app_routes_global_ratings'));
    li(field_bool_data_from_list($document, 'sub_activities', 'mod_routes_sub_activities_list', array('single_value' => 2, 'show_only_yes' => true)));
    li(field_bool_data_from_list($document, 'sub_activities', 'mod_routes_sub_activities_list', array('single_value' => 4, 'show_only_yes' => true)));
}
if (in_array(6, $activities)) {
    li(field_data_from_list($document, 'hiking_rating', 'app_routes_hiking_ratings'), array('class' => 'separator'));
}
if (in_array(7, $activities)) {
    li(field_data_from_list($document, 'snowshoeing_rating', 'app_routes_snowshoeing_ratings'), array('class' => 'separator'));
}
li($first = field_bool_data_from_list($document, 'sub_activities', 'mod_routes_sub_activities_list', array('single_value' => 6, 'show_only_yes' => true)), array('class' => 'separator'));
li(field_bool_data_from_list($document, 'sub_activities', 'mod_routes_sub_activities_list', array('single_value' => 8, 'show_only_yes' => true)), empty($first));
if ($document->get('geom_wkt')) {
    li(field_export($document->get('module'), $sf_params->get('id'), $sf_params->get('lang'), $sf_params->get('version')), array('class' => 'separator'));
}
?>
</ul>
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:30,代码来源:_data.php

示例12: make_li_b

function make_li_b($d)
{
    $r = explode("\n", $d);
    foreach ($r as $v) {
        if (trim($v)) {
            $ret .= li(trim($v));
        }
    }
    if ($ret) {
        return ul($ret);
    }
}
开发者ID:philum,项目名称:cms,代码行数:12,代码来源:tri.php

示例13: use_helper

<?php

use_helper('Object', 'Language', 'Validation', 'MyForm', 'Field');
// Here document = route
echo '<div>';
display_document_edit_hidden_tags($document);
echo '</div>';
echo mandatory_fields_warning();
include_partial('documents/language_field', array('document' => $document, 'new_document' => $new_document));
echo object_group_tag($document, 'name', array('class' => 'long_input'));
echo form_section_title('Information', 'form_info', 'preview_info');
if ($sf_user->hasCredential('moderator')) {
    echo object_group_dropdown_tag($document, 'area_type', 'mod_areas_area_types_list');
} else {
    ?>
<ul class="data">
  <?php 
    li(field_data_from_list($document, 'area_type', 'mod_areas_area_types_list'));
    ?>
</ul>
<?php 
    echo object_input_hidden_tag($document, 'getArea_type');
}
echo form_section_title('Description', 'form_desc', 'preview_desc');
echo object_group_bbcode_tag($document, 'description', null, array('class' => 'largetext', 'abstract' => true));
include_partial('documents/form_history');
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:26,代码来源:_form_fields.php

示例14: tpl_toggler

 /**
  * Toggler template
  * @return string
  **/
 public function tpl_toggler()
 {
     if (empty($this->toggler)) {
         return;
     }
     $OBJ =& get_instance();
     $out = '';
     foreach ($this->toggler as $key => $tab) {
         $attr = !isset($tab[2]) ? 'left' : 'right';
         $float = $attr === 'right' ? "float:right;" : "float:left;";
         $show = $key === 0 ? " class='tabOn'" : " class='tabOff'";
         $out .= li(href($tab[0], "#"), "id='a{$tab['0']}' style='{$float}' onclick=\"editTab('{$tab['0']}');\"{$show}");
     }
     return ul($out, "class='tabs'") . div('<!-- -->', "class='cl'");
 }
开发者ID:WurdahMekanik,项目名称:hlf-ndxz,代码行数:19,代码来源:template.php

示例15: sort

        }
    }
    sort($entries);
    $out = array();
    foreach ($entries as $e) {
        if ($form == 'long') {
            $stats = stat($WIKI_PAGEDIR . "{$e}");
        }
        if ($lastentry[0] != $e[0]) {
            if (count($out) > 0) {
                print ul(join('', $out));
                $out = array();
            }
            print "<h3>" . $e[0] . "</h3>";
        }
        $out[] = li(hyperlink($_SERVER['SCRIPT_NAME'] . "/{$WIKI_REPOSITORY}{$e}", $e) . ($form == 'long' ? date(' Y/M/d H:i:s T', $stats[9]) : ""));
        $lastentry = $e;
    }
    if (count($out) > 0) {
        print ul(join('', $out));
    }
    unset($out);
} elseif ($action == 'revisions') {
    $revisions = rcs_get_revisions($WIKI_PAGEDIR . "{$pagename}");
    $tags = array_flip(rcs_get_symbolic_names($WIKI_PAGEDIR . "{$pagename}"));
    print "<dl>";
    foreach ($revisions as $revision => $rinfo) {
        print "<dt>" . hyperlink(preg_replace('/;.*$/', '', $_SERVER['PHP_SELF']) . ";{$revision}", $revision) . (isset($tags[$revision]) ? " A.K.A.\n\t\t\t\t" . hyperlink($SELF_NOVERSION . ";" . $tags[$revision], $tags[$revision]) : '') . "</dt>" . "<dd>" . date("Y/m/d H:i:s T (O)", strtotime($rinfo['date'] . ' GMT')) . "<br />" . wiki_render($rinfo['message'] . "\n") . "</dd>";
    }
    print "</dl>";
} elseif ($action == 'info') {
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:31,代码来源:index.php


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