當前位置: 首頁>>代碼示例>>PHP>>正文


PHP smarty_function_html_options_optgroup函數代碼示例

本文整理匯總了PHP中smarty_function_html_options_optgroup函數的典型用法代碼示例。如果您正苦於以下問題:PHP smarty_function_html_options_optgroup函數的具體用法?PHP smarty_function_html_options_optgroup怎麽用?PHP smarty_function_html_options_optgroup使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了smarty_function_html_options_optgroup函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: smarty_function_html_options_optoutput

function smarty_function_html_options_optoutput($key,$value,$selected) {
if(!is_array($value)) {
$_html_result = '<option label="'.smarty_function_escape_special_chars($value) .'" value="'.
smarty_function_escape_special_chars($key) .'"';
if (in_array((string)$key,$selected))
$_html_result .= ' selected="selected"';
$_html_result .= '>'.smarty_function_escape_special_chars($value) .'</option>'."\n";
}else {
$_html_result = smarty_function_html_options_optgroup($key,$value,$selected);
}
return $_html_result;
}
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:12,代碼來源:function.html_options.php

示例2: smarty_function_html_options_optoutput

function smarty_function_html_options_optoutput($key, $value, $selected)
{
    if (!is_array($value)) {
        $html_result = '<option label="' . htmlspecialchars($value) . '" value="' . htmlspecialchars($key) . '"';
        if (in_array($key, $selected)) {
            $html_result .= " selected=\"selected\"";
        }
        $html_result .= '>' . htmlspecialchars($value) . '</option>' . "\n";
    } else {
        $html_result = smarty_function_html_options_optgroup($key, $value, $selected);
    }
    return $html_result;
}
開發者ID:BackupTheBerlios,項目名稱:logicalframe,代碼行數:13,代碼來源:function.html_options.php

示例3: smarty_function_html_options_optoutput

function smarty_function_html_options_optoutput($key, $value, $selected)
{
    if (!is_array($value)) {
        $html_result = "<option label=\"{$key}\" value=\"{$key}\"";
        if (in_array($key, $selected)) {
            $html_result .= " selected=\"selected\"";
        }
        $html_result .= ">{$value}</option>\n";
    } else {
        $html_result = smarty_function_html_options_optgroup($key, $value, $selected);
    }
    return $html_result;
}
開發者ID:katopenzz,項目名稱:openemr,代碼行數:13,代碼來源:function.html_options.php

示例4: smarty_function_html_options_optoutput

function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
{
    if (!is_array($value)) {
        $_key = smarty_function_escape_special_chars($key);
        $_html_result = '<option value="' . $_key . '"';
        if (is_array($selected)) {
            if (isset($selected[$_key])) {
                $_html_result .= ' selected="selected"';
            }
        } elseif ($_key === $selected) {
            $_html_result .= ' selected="selected"';
        }
        $_html_class = !empty($class) ? ' class="' . $class . ' option"' : '';
        $_html_id = !empty($id) ? ' id="' . $id . '-' . $idx . '"' : '';
        if (is_object($value)) {
            if (method_exists($value, "__toString")) {
                $value = smarty_function_escape_special_chars((string) $value->__toString());
            } else {
                trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE);
                return '';
            }
        } else {
            $value = smarty_function_escape_special_chars((string) $value);
        }
        $_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . "\n";
        $idx++;
    } else {
        $_idx = 0;
        $_html_result = smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? $id . '-' . $idx : null, $class, $_idx);
        $idx++;
    }
    return $_html_result;
}
開發者ID:BozzaCoon,項目名稱:SPHERE-Framework,代碼行數:33,代碼來源:function.html_options.php

示例5: smarty_function_html_options_optoutput

function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
{
    if (!is_array($value)) {
        $_html_result = '<option value="' . smarty_function_escape_special_chars($key) . '"';
        if (in_array((string) $key, $selected)) {
            $_html_result .= ' selected="selected"';
        }
        $_html_class = !empty($class) ? ' class="' . $class . ' option"' : '';
        $_html_id = !empty($id) ? ' id="' . $id . '-' . $idx . '"' : '';
        $_html_result .= $_html_class . $_html_id . '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
        $idx++;
    } else {
        $_idx = 0;
        $_html_result = smarty_function_html_options_optgroup($key, $value, $selected, $id . '-' . $idx, $class, $_idx);
        $idx++;
    }
    return $_html_result;
}
開發者ID:tv13,項目名稱:bambitav,代碼行數:18,代碼來源:function.html_options.php

示例6: smarty_function_wap_html_options_optoutput

function smarty_function_wap_html_options_optoutput($key, $value, $selected)
{
    if (!is_array($value)) {
        $_html_result = '<option value="' . smarty_function_escape_special_chars($key) . '"';
        $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
    } else {
        $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
    }
    return $_html_result;
}
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:10,代碼來源:function.wap_html_options.php


注:本文中的smarty_function_html_options_optgroup函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。