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


PHP theme::smart_model方法代碼示例

本文整理匯總了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();
開發者ID:ProjectOrangeBox,項目名稱:login-success,代碼行數:22,代碼來源:index.php

示例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();
開發者ID:ProjectOrangeBox,項目名稱:orange-export-import,代碼行數:31,代碼來源:nav.php

示例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 ' &rArr; ';
    theme::smart_model('o_role', $record->role_id, 'description');
    theme::table_row();
    theme::smart_model('o_access', $record->access_id, 'name');
    echo ' &rArr; ';
    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();
開發者ID:ProjectOrangeBox,項目名稱:orange-export-import,代碼行數:25,代碼來源:role_access.php


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