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


PHP User::findUserById方法代碼示例

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


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

示例1: index

 public function index($id = null)
 {
     if (!$id) {
         \Core\Route::redirectTo('/absent');
     } else {
         $id = str_replace("id", "", $id);
         $user = \Models\User::findUserById($id);
         if (isset($user['id'])) {
             $user = \Models\User::getUserPersonalById($user['id']);
             $task = \Models\Load::issetUploadFile('task');
             if ($task != false) {
                 \Models\Load::uploadTask($_FILES[$task]);
             }
             $data = \Models\User::findUserById($id);
             $tasks = \Models\Task::showTask();
             echo View::make('header', ['title' => $user['l_name'] . " " . $user['f_name']]);
             if ($user['member'] == 'Mather') {
                 echo View::make('user.leftside', ['id' => $id, 'user' => $user]);
             }
             if ($user['member'] == 'Father') {
                 echo View::make('user.profileF', ['data' => $data, 'tasks' => $tasks]);
             } else {
                 echo View::make('user.profile', ['data' => $data, 'tasks' => $tasks]);
             }
             echo View::make('footer');
         } else {
             \Core\Route::redirectTo('/absent');
         }
     }
 }
開發者ID:kazak600,項目名稱:Task-manager,代碼行數:30,代碼來源:user.php

示例2: index

 public function index($id = null)
 {
     if (!$id) {
         \Core\Route::redirectTo('/absent');
     } else {
         $id = str_replace("id", "", $id);
         $user = \Models\User::findUserById($id);
         if (isset($user['id'])) {
             $user = \Models\User::getUserPersonalById($user['id']);
             $avatar = \Models\Images::issetUploadImages('avatar');
             if ($avatar != false) {
                 \Models\Images::uploadAvatar($_FILES[$avatar]);
             }
             $plug = \Models\Images::isPlug($id . '.jpg');
             $data = \Models\User::findUserById($id);
             echo View::make('header', ['title' => $user['l_name'] . " " . $user['f_name']]);
             echo View::make('user.leftside', ['id' => $id, 'user' => $user, 'plug' => $plug]);
             echo View::make('user.profile', ['data' => $data]);
             echo View::make('footer');
         } else {
             \Core\Route::redirectTo('/absent');
         }
     }
 }
開發者ID:kazak600,項目名稱:test-task.dev,代碼行數:24,代碼來源:user.php

示例3: foreach

<h1>Список Объявлений</h1>

<?php 
foreach ($items as $item) {
    ?>

    <p><?php 
    echo $item['title'];
    ?>
 by <?php 
    echo \models\User::findUserById($item['owner'])->username;
    ?>
 at <?php 
    echo date('Y:m:d', \models\User::findUserById($item['owner'])->date_created);
    ?>
</p>

<?php 
}
?>
<a href="<?php 
echo \helpers\Url::to(['items/create']);
?>
">Create new</a>
開發者ID:pauk2012,項目名稱:test_desk,代碼行數:24,代碼來源:index.php


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