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


PHP theme::format_value方法代碼示例

本文整理匯總了PHP中theme::format_value方法的典型用法代碼示例。如果您正苦於以下問題:PHP theme::format_value方法的具體用法?PHP theme::format_value怎麽用?PHP theme::format_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在theme的用法示例。


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

示例1: foreach

theme::table_tabs($records['records']);
theme::table_tabs_start();
foreach ($records['records'] as $tab => $tab_records) {
    theme::table_tab_pane_start($tab);
    theme::table_start(['Name', 'Value', 'Managed' => 'text-center', 'Actions' => 'text-center']);
    /* show them in the order they where entered */
    uasort($tab_records, function ($a, $b) {
        return $a->id > $b->id ? 1 : -1;
    });
    foreach ($tab_records as $record) {
        theme::table_start_tr();
        echo !$record->enabled ? '<i class="text-muted">' : '';
        o::e($record->name);
        echo !$record->enabled ? '</i>' : '';
        theme::table_row();
        echo theme::format_value($record->value, 128);
        theme::table_row('larger text-center');
        echo theme::enum_icon((int) $record->managed);
        theme::table_row('actions text-center');
        if ($record->is_editable) {
            theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
        }
        if (has_access('orange::advanced settings')) {
            theme::table_action('pencil-square', $this->controller_path . '/edit/' . $record->id . '/advanced');
        }
        if ($record->is_deletable) {
            o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
        }
        theme::table_end_tr();
    }
    theme::table_end();
開發者ID:galdiolo,項目名稱:theme-orange,代碼行數:31,代碼來源:index.php

示例2: looper

 public static function looper($all, $which)
 {
     $overridden_icon = '<i class="fa fa-exchange"></i>';
     $controller_path = ci()->page->data('controller_path');
     $inp = $all[$which];
     if (count($inp) > 0) {
         echo '<table class="table table-condensed" style="margin:0">';
         foreach ($inp as $name => $value) {
             $show_as = 0;
             /* text area default */
             $overridden = '&nbsp;';
             $link = '&nbsp;';
             switch ($which) {
                 case 'db':
                     if ($all['db'][$name] != $all['env'][$name] && isset($all['env'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     if ($all['db'][$name] != $all['file'][$name] && isset($all['db'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     break;
                 case 'env':
                     if ($all['env'][$name] != $all['file'][$name] && isset($all['file'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     break;
                 case 'file':
                     if ($all['file'][$name] != $all['env'][$name] && isset($all['env'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     break;
             }
             $group = ci()->uri->segment(5);
             switch (gettype($value)) {
                 case 'string':
                 case 'integer':
                 case 'null':
                 case 'float':
                     break;
                 case 'boolean':
                     $show_as = 1;
                     /* true / false radio's */
                     break;
             }
             if (!ci()->o_setting_model->compound_key_exists($name, $group) && $which == 'merged') {
                 $hash = bin2hex($name . chr(0) . convert_to_string($value) . chr(0) . $group . chr(0) . $show_as);
                 $link = '<a class="js-add-link" href="' . $controller_path . '/add/' . $hash . '"><i class="fa fa-plus-square"></i></a>';
             }
             echo '<tr>';
             echo '<td width="47%">' . $name . '&nbsp;</td>';
             echo '<td style="width:47%;">' . theme::format_value($value) . '</td>';
             echo '<td style="width:3%; text-align:center">' . $link . '</td>';
             echo '<td style="width:3%; text-align:center">' . $overridden . '</td>';
             echo '</tr>';
         }
         echo '</table>';
     }
 }
開發者ID:dmyers2004,項目名稱:theme-orange,代碼行數:58,代碼來源:SettingController.php


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