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


PHP span函数代码示例

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


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

示例1: wrap

 /**
  *	@fn wrap($term)
  *	@short Wraps a string in a parent HTML element to add debug style selectors.
  *	@param term The string to be wrapped.
  */
 private static function wrap($term)
 {
     if (!LOCALIZATION_DEBUG) {
         return $term;
     }
     return span($term, array('class' => 'localization-debug'));
 }
开发者ID:emeraldion,项目名称:creso,代码行数:12,代码来源:localization.php

示例2: __toString

 /**
  *	@fn __toString
  *	@details Returns a string representation of the gate object.
  */
 public function __toString()
 {
     $params = $this->params;
     array_walk($params, create_function('&$val, $key', '$val = span("$key", array(\'class\' => \'code-array-key\')) . ' . 'span(\' => \', array(\'class\' => \'code-delimiter\')) . ' . 'span("\'$val\'", array(\'class\' => \'code-literal\'));'));
     $params = empty($params) ? '' : implode(span(', ', array('class' => 'code-delimiter')), $params);
     return span("{$this->controller}Controller", array('class' => 'code-class')) . span('::', array('class' => 'code-operator')) . span($this->action, array('class' => 'code-method')) . span('(', array('class' => 'code-delimiter')) . span($params, array('class' => 'code-method-params')) . span(')', array('class' => 'code-delimiter'));
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:11,代码来源:gate.php

示例3: 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

示例4: doLoginForm

/**
 * Renders and outputs a login form.
 *
 * This function outputs a full HTML document,
 * including <head> and footer.
 *
 * @param string|array $message The activity message
 */
function doLoginForm($message)
{
    global $textarray_script, $event, $step;
    include txpath . '/lib/txplib_head.php';
    $event = 'login';
    if (gps('logout')) {
        $step = 'logout';
    } elseif (gps('reset')) {
        $step = 'reset';
    }
    pagetop(gTxt('login'), $message);
    $stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
    $reset = gps('reset');
    $name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
    $out = array();
    if ($reset) {
        $out[] = hed(gTxt('password_reset'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), ' class="login-name"') . graf(fInput('submit', '', gTxt('password_reset_button'), 'publish') . n) . graf(href(gTxt('back_to_login'), 'index.php'), array('class' => 'login-return')) . hInput('p_reset', 1);
    } else {
        $out[] = hed(gTxt('login_to_textpattern'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), array('class' => 'login-name')) . graf(n . span(tag(gTxt('password'), 'label', array('for' => 'login_password')), array('class' => 'txp-label')) . n . span(fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password'), array('class' => 'txp-value')), array('class' => 'login-password')) . graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . tag(gTxt('stay_logged_in'), 'label', array('for' => 'login_stay')) . popHelp('remember_login') . n, array('class' => 'login-stay')) . graf(fInput('submit', '', gTxt('log_in_button'), 'publish') . n) . graf(href(gTxt('password_forgotten'), '?reset=1'), array('class' => 'login-forgot'));
        if (gps('event')) {
            $out[] = eInput(gps('event'));
        }
    }
    echo form(tag(join('', $out), 'section', array('role' => 'region', 'class' => 'txp-login', 'aria-labelledby' => 'txp-login-heading')), '', '', 'post', '', '', 'login_form') . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</main><!-- /txp-body -->' . n . '</body>' . n . '</html>';
    exit(0);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:34,代码来源:txp_auth.php

示例5: page_edit

/**
 * The main Page editor panel.
 *
 * @param string|array $message The activity message
 */
function page_edit($message = '')
{
    global $event, $step;
    pagetop(gTxt('edit_pages'), $message);
    extract(array_map('assert_string', gpsa(array('copy', 'save_error', 'savenew'))));
    $name = sanitizeForPage(assert_string(gps('name')));
    $newname = sanitizeForPage(assert_string(gps('newname')));
    if ($step == 'page_delete' || empty($name) && $step != 'page_new' && !$savenew) {
        $name = safe_field('page', 'txp_section', "name = 'default'");
    } elseif ((($copy || $savenew) && $newname || $newname && $newname != $name) && !$save_error) {
        $name = $newname;
    }
    $buttons = n . tag(gTxt('page_name'), 'label', array('for' => 'new_page')) . br . fInput('text', 'newname', $name, 'input-medium', '', '', INPUT_MEDIUM, '', 'new_page', false, true);
    if ($name) {
        $buttons .= span(href(gTxt('duplicate'), '#', array('id' => 'txp_clone', 'class' => 'clone', 'title' => gTxt('page_clone'))), array('class' => 'txp-actions'));
    } else {
        $buttons .= hInput('savenew', 'savenew');
    }
    $html = !$save_error ? fetch('user_html', 'txp_page', 'name', $name) : gps('html');
    // Format of each entry is popTagLink -> array ( gTxt() string, class/ID).
    $tagbuild_items = array('page_article' => array('page_article_hed', 'article-tags'), 'page_article_nav' => array('page_article_nav_hed', 'article-nav-tags'), 'page_nav' => array('page_nav_hed', 'nav-tags'), 'page_xml' => array('page_xml_hed', 'xml-tags'), 'page_misc' => array('page_misc_hed', 'misc-tags'), 'page_file' => array('page_file_hed', 'file-tags'));
    $tagbuild_links = '';
    foreach ($tagbuild_items as $tb => $item) {
        $tagbuild_links .= wrapRegion($item[1] . '_group', taglinks($tb), $item[1], $item[0], 'page_' . $item[1]);
    }
    echo hed(gTxt('tab_pages'), 1, array('class' => 'txp-heading'));
    echo n . tag(n . tag(hed(gTxt('tagbuilder'), 2) . $tagbuild_links, 'div', array('id' => 'tagbuild_links', 'class' => 'txp-layout-cell txp-layout-1-4')) . n . tag(form(graf($buttons) . graf(tag(gTxt('page_code'), 'label', array('for' => 'html')) . br . '<textarea class="code" id="html" name="html" cols="' . INPUT_LARGE . '" rows="' . TEXTAREA_HEIGHT_LARGE . '" dir="ltr">' . txpspecialchars($html) . '</textarea>') . graf(fInput('submit', '', gTxt('save'), 'publish') . eInput('page') . sInput('page_save') . hInput('name', $name)), '', '', 'post', 'edit-form', '', 'page_form'), 'div', array('id' => 'main_content', 'class' => 'txp-layout-cell txp-layout-2-4')) . n . tag(graf(sLink('page', 'page_new', gTxt('create_new_page')), ' class="action-create"') . page_list($name) . n, 'div', array('id' => 'content_switcher', 'class' => 'txp-layout-cell txp-layout-1-4')) . n, 'div', array('id' => $event . '_container', 'class' => 'txp-layout-grid'));
}
开发者ID:hcgtv,项目名称:textpattern,代码行数:33,代码来源:txp_page.php

示例6: textile

 function textile($text, $lite = '')
 {
     if (get_magic_quotes_gpc() == 1) {
         $text = stripslashes($text);
     }
     $text = incomingEntities($text);
     $text = encodeEntities($text);
     $text = fixEntities($text);
     $text = cleanWhiteSpace($text);
     $text = getRefs($text);
     $text = noTextile($text);
     $text = image($text);
     $text = links($text);
     $text = span($text);
     $text = superscript($text);
     $text = footnoteRef($text);
     $text = code($text);
     $text = glyphs($text);
     $text = retrieve($text);
     if ($lite == '') {
         $text = lists($text);
         $text = table($text);
         $text = block($text);
     }
     /* clean up <notextile> */
     $text = preg_replace('/<\\/?notextile>/', "", $text);
     /* turn the temp char back to an ampersand entity */
     $text = str_replace("x%x%", "&amp;", $text);
     $text = str_replace("<br />", "<br />\n", $text);
     return trim($text);
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:textile2.php

示例7: filename

 /**
  *	@fn filename
  *	@short Returns the filename of the artifact.
  */
 public function filename()
 {
     if (!$this->file_exists()) {
         return span($this->file, array('class' => 'missing-file', 'title' => l('Missing file')));
     }
     return $this->file;
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:11,代码来源:software_artifact.php

示例8: pretty_diff_percent

 function pretty_diff_percent($other)
 {
     if (!isset($this->quotazione) || !isset($other->quotazione)) {
         return self::NOPE;
     }
     $plusminus_pct = 100 * ($this->quotazione - $other->quotazione) / $this->quotazione;
     return span(sprintf('%.2f%%', $plusminus_pct), array('style' => 'color: ' . ($plusminus_pct < 0 ? 'red' : 'green')));
 }
开发者ID:emeraldion,项目名称:creso,代码行数:8,代码来源:quote.php

示例9: footer

 function footer()
 {
     global $txp_user;
     $out[] = '<a id="mothership" href="http://textpattern.com/" title="' . gTxt('go_txp_com') . '" rel="external"><img src="' . $this->url . 'carver.png" width="40" height="40" alt="Textpattern" /></a>' . n . graf('Textpattern CMS &#183; ' . txp_version);
     if ($txp_user) {
         $out[] = graf(gTxt('logged_in_as') . ' ' . span(txpspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"');
     }
     return join(n, $out);
 }
开发者ID:balcides,项目名称:Cathartic_server,代码行数:9,代码来源:classic.php

示例10: footer

 function footer()
 {
     global $txp_user;
     $out[] = '<div id="end_page">' . n . '<a href="http://textpattern.com/" id="mothership"><img src="' . $this->url . 'carver.gif" width="60" height="48" border="0" alt="" /></a>' . n . graf('Textpattern &#183; ' . txp_version);
     if ($txp_user) {
         $out[] = graf(gTxt('logged_in_as') . ' ' . span(htmlspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"');
     }
     $out[] = '</div>';
     return join(n, $out);
 }
开发者ID:bgarrels,项目名称:textpattern,代码行数:10,代码来源:classic.php

示例11: plug_poll

function plug_poll($p, $o)
{
    if ($p == 'init') {
        poll_init();
    }
    if ($p) {
        $ret = poll_menu($p);
    }
    return span(atd('poll' . $p) . atc('small'), $ret);
}
开发者ID:philum,项目名称:cms,代码行数:10,代码来源:poll.php

示例12: end_page

function end_page()
{
    global $txp_user, $event;
    if ($event != 'tag') {
        echo '<div id="end_page">', navPop() . n, '<a href="http://www.textpattern.com"><img src="txp_img/carver.gif" width="60" height="48" border="0" alt="" /></a>' . n;
        echo graf('Textpattern &#183; ' . txp_version) . n;
        echo $txp_user ? graf(gTxt('logged_in_as') . ' ' . span(htmlspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"') . n . '</div>' : '</div>';
        echo n . '</body>' . n . '</html>';
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:10,代码来源:txplib_html.php

示例13: np_sav

function np_sav($d, $id)
{
    $ret = hidden('', 'cka', 'm' . $d);
    for ($i = 1; $i <= 7; $i++) {
        $c = $i == $d ? 'active' : '';
        $ret .= ljb($c . '" id="ckb' . $i, 'mem_storage', $id . '_m' . $i . '_1_1_ckb' . $i . '_memnu', $i);
    }
    $ret .= ljb('" id="ckc', 'mem_storage', $id . '_cka__1_ckc', 'save');
    return span(atc('nbp') . atd('memnu'), $ret) . hlpbt('memstorage');
}
开发者ID:philum,项目名称:cms,代码行数:10,代码来源:notepad.php

示例14: initNavbar

 private function initNavbar()
 {
     $this->navbar = div('', 'navbar');
     foreach (Config::getCfg('navlinks') as $name => $link) {
         $this->navbar->append(a(span("&nbsp;{$name}&nbsp;", 'navelement'), $link));
     }
     $stylelist = el('ul');
     foreach (Config::getCfg("styles") as $name => $css) {
         $stylelist->append(el('li', a("&nbsp;{$name}&nbsp;", "javascript:")->set("onclick", "StyleSwitcher.switchTo('{$name}')")->set("class", 'navelement')->set("title", $name)));
     }
     $this->navbar->append(el('ul', el('li', '[Page Style]' . $stylelist, ['class' => 'navelement']), ['class' => 'stylemenu']));
 }
开发者ID:bstats,项目名称:b-stats,代码行数:12,代码来源:Page.php

示例15: codeline

function codeline($v, $p, $c)
{
    //v§p:c //v:c
    switch ($c) {
        //elements
        case 'br':
            return br();
            break;
        case 'hr':
            return hr();
            break;
        case 'balise':
            if ($p) {
                @(list($bal, $id, $css, $sty) = explode('|', $p));
                if ($v) {
                    return balise($bal, array(5 => $css, 3 => $id, 16 => $sty), $v);
                }
            }
            break;
        case 'html':
            if ($p && $v) {
                return bal($p, $v);
            }
            break;
        case 'span':
            if (trim($v)) {
                return span($p, $v);
            }
            break;
        case 'div':
            if (trim($v)) {
                return div($p, $v);
            }
            break;
        case 'css':
            if (trim($v)) {
                return btn($p, $v);
            }
            break;
        case 'clear':
            return divc($c, $v);
            break;
            //attributs
        //attributs
        case 'id':
            return atd($c, $v);
            break;
        case 'class':
            return atb($c, $v);
            break;
        case 'style':
            return atb($c, $v);
            break;
        case 'name':
            return atb($c, $v);
            break;
        case 'font-size':
            return atb($c, $v);
            break;
        case 'font-family':
            return atb($c, $v);
            break;
            //apps
        //apps
        case 'text':
            return $v ? $v : $p;
            break;
        case 'url':
            return lka($v, $p ? $p : preplink($v));
            break;
        case 'jurl':
            return lj('', $v, $p);
            break;
        case 'link':
            return special_link($v . '§' . $p);
            break;
        case 'ajx':
            return lj('', 'popup', '_' . $p, $v);
            break;
        case 'anchor':
            return '<a name="' . $v . '"></a>';
            break;
        case 'date':
            return mkday(is_numeric($p) ? $p : '', $v);
            break;
        case 'title':
            return suj_of_id($v);
            break;
        case 'read':
            return read_msg($p, 3);
            break;
        case 'image':
            return image($v);
            break;
        case 'thumb':
            return make_thumb_d($v, $p);
            break;
        case 'picto':
            return picto($v, $p);
            break;
//.........这里部分代码省略.........
开发者ID:philum,项目名称:cms,代码行数:101,代码来源:pop.php


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