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


PHP Util_Ui::config_label方法代码示例

本文整理汇总了PHP中Util_Ui::config_label方法的典型用法代码示例。如果您正苦于以下问题:PHP Util_Ui::config_label方法的具体用法?PHP Util_Ui::config_label怎么用?PHP Util_Ui::config_label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util_Ui的用法示例。


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

示例1:

<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
?>
<tr>
    <th colspan="2">
        <?php 
$key = 'stats.enabled';
$c = Dispatcher::config();
$value = $c->get($key);
$label = Util_Ui::config_label($key);
$name = Util_Ui::config_key_to_http_name($key);
Util_Ui::checkbox($key, $name, $value, $c->is_sealed('common.'), $label);
?>
    </th>
</tr>
<?php 
开发者ID:eduardodomingos,项目名称:eduardodomingos.com,代码行数:21,代码来源:UsageStatistics_View_General.php

示例2: config_item

 /**
  * Prints configuration item UI based on description
  *   key => configuration key
  *   label => configuration key's as its introduced to the user
  *   value => it's value
  *   disabled => if disabled
  *
  *   control => checkbox | radiogroup | selectbox | textbox
  *   checkbox_label => text shown after the textbox
  *   radiogroup_values => array of possible values for radiogroup
  *   selectbox_values => array of possible values for dropdown
  *   selectbox_optgroups =>
  *   textbox_size =>
  *
  *   description => description shown to the user below
  */
 public static function config_item($a)
 {
     $c = Dispatcher::config();
     if (!isset($a['value']) || is_null($a['value'])) {
         $a['value'] = $c->get($a['key']);
         if (is_array($a['value'])) {
             $a['value'] = implode('\\n', $a['value']);
         }
     }
     if (isset($a['disabled']) && !is_null($a['disabled'])) {
         $disabled = $a['disabled'];
     } else {
         $disabled = $c->is_sealed($a['key']);
     }
     if (empty($a['label'])) {
         $a['label'] = Util_Ui::config_label($a['key']);
     }
     $action_key = $a['key'];
     if (is_array($action_key)) {
         $action_key = 'extension.' . $action_key[0] . '.' . $action_key[1];
     }
     $a = apply_filters('w3tc_ui_config_item_' . $action_key, $a);
     // convert to table_tr data
     $table_tr = array('id' => Util_Ui::config_key_to_http_name($a['key']), 'label' => $a['label']);
     if (isset($a['style'])) {
         $table_tr['style'] = $a['style'];
     }
     if ($a['control'] == 'checkbox') {
         $table_tr['label_class'] = 'w3tc_config_checkbox';
         $table_tr['checkbox'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'label' => $a['checkbox_label']);
     } else {
         if ($a['control'] == 'radiogroup') {
             $table_tr['radiogroup'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'values' => $a['radiogroup_values']);
         } else {
             if ($a['control'] == 'selectbox') {
                 $table_tr['selectbox'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'values' => $a['selectbox_values'], 'optgroups' => isset($a['selectbox_optgroups']) ? $a['selectbox_optgroups'] : null);
             } else {
                 if ($a['control'] == 'textbox') {
                     $table_tr['textbox'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled, 'size' => isset($a['textbox_size']) ? $a['textbox_size'] : null);
                 } else {
                     if ($a['control'] == 'textarea') {
                         $table_tr['textarea'] = array('name' => Util_Ui::config_key_to_http_name($a['key']), 'value' => $a['value'], 'disabled' => $disabled);
                     }
                 }
             }
         }
     }
     if (isset($a['description'])) {
         $table_tr['description'] = $a['description'];
     }
     Util_Ui::table_tr($table_tr);
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:68,代码来源:Util_Ui.php


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