本文整理汇总了PHP中theme::smart_model方法的典型用法代码示例。如果您正苦于以下问题:PHP theme::smart_model方法的具体用法?PHP theme::smart_model怎么用?PHP theme::smart_model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme
的用法示例。
在下文中一共展示了theme::smart_model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
theme::header_start('Successful Logins', 'View successful logins');
Plugin_search_sort::field();
if (count($records) > 0) {
o_dialog::confirm_button($controller_path . '/flush/90', '90 Days+', 'trash', 'Successful Logins', 'Do you want to delete successful logins greater then 90 days', ['redirect' => 'true']);
o_dialog::confirm_button($controller_path . '/flush/30', '30 Days+', 'trash', 'Successful Logins', 'Do you want to delete successful logins greater then 30 days?', ['redirect' => 'true']);
o_dialog::confirm_button($controller_path . '/clear', 'All', 'trash', 'Successful Logins', 'Do you want to delete all successful logins?', ['redirect' => 'true']);
}
theme::header_end();
theme::table_start(['On', 'By', 'Email'], [], $records);
foreach ($records as $record) {
theme::table_start_tr();
theme::date($record->created_on);
theme::table_row();
theme::smart_model('o_user_model', $record->created_by, 'username');
theme::table_row();
theme::e($record->email);
theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
示例2: foreach
<?php
theme::form_start($controller_path . '/nav', null, ['data-validate' => false]);
theme::header_start('Export Menus');
Plugin_search_sort::field();
theme::header_button('Export File', ['icon' => 'upload', 'action' => 'js-post']);
theme::header_button('back');
theme::header_end();
theme::table_start(['Name', 'Value', 'Export' => 'text-center'], [], $records);
$parent_id = '';
foreach ($records as $record) {
if ($parent_id != $record->parent_id) {
echo '<tr><td colspan="4"><strong>Parent: ';
ob_start();
theme::smart_model('o_menubar', $record->parent_id, 'text');
$text = ob_get_contents();
ob_end_clean();
echo empty($text) ? 'Root Level' : $text;
echo '</strong></td></tr>';
$parent_id = $record->parent_id;
}
theme::table_start_tr();
theme::e($record->text);
theme::table_row();
theme::e($record->url);
theme::table_row('actions text-center');
echo '<input type="checkbox" name="export[]" value="' . $record->id . '">';
theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
示例3: foreach
<?php
theme::form_start($controller_path . '/role-access', null, ['data-validate' => false]);
theme::header_start('Export Roles <i class="fa fa-arrows-h"></i> Access');
Plugin_search_sort::field();
theme::header_button('Export File', ['icon' => 'upload', 'action' => 'js-post']);
theme::header_button('back');
theme::header_end();
theme::table_start(['Role', 'Access', 'Export' => 'text-center'], [], $records);
foreach ($records as $record) {
theme::table_start_tr();
theme::smart_model('o_role', $record->role_id, 'name');
echo ' ⇒ ';
theme::smart_model('o_role', $record->role_id, 'description');
theme::table_row();
theme::smart_model('o_access', $record->access_id, 'name');
echo ' ⇒ ';
theme::smart_model('o_access', $record->access_id, 'description');
theme::table_row('actions text-center');
echo '<input type="checkbox" name="export[]" value="' . bin2hex($record->role_id . '::' . $record->access_id) . '">';
theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
theme::form_end();