本文整理汇总了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();
示例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 = ' ';
$link = ' ';
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 . ' </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>';
}
}