当前位置: 首页>>代码示例>>PHP>>正文


PHP UserModel::getPublicProfileOfUser方法代码示例

本文整理汇总了PHP中UserModel::getPublicProfileOfUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::getPublicProfileOfUser方法的具体用法?PHP UserModel::getPublicProfileOfUser怎么用?PHP UserModel::getPublicProfileOfUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserModel的用法示例。


在下文中一共展示了UserModel::getPublicProfileOfUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showProfile

 /**
  * This method controls what happens when you move to /overview/showProfile in your app.
  * Shows the (public) details of the selected user.
  * @param $user_id int id the the user
  */
 public function showProfile($user_id)
 {
     if (isset($user_id)) {
         $this->View->render('profile/showProfile', array('user' => UserModel::getPublicProfileOfUser($user_id)));
     } else {
         Redirect::home();
     }
 }
开发者ID:queer1,项目名称:PC-Track,代码行数:13,代码来源:ProfileController.php

示例2: saveRoleToDatabase

 /**
  * Writes the new account type marker to the database and to the session
  *
  * @param $type
  *
  * @return bool
  */
 public static function saveRoleToDatabase($type)
 {
     // if $type is not 1 or 2
     if (!in_array($type, [1, 2])) {
         return false;
     }
     $user = UserModel::getPublicProfileOfUser(Session::get('user_id'));
     $user->setUserAccountType($type);
     $user->save();
     if ($user) {
         Session::set('user_account_type', $type);
         return true;
     }
     return false;
 }
开发者ID:KyleGoslan,项目名称:Huge-Propel,代码行数:22,代码来源:UserRoleModel.php

示例3: setRememberMeInDatabaseAndCookie

 /**
  * Write remember-me token into database and into cookie
  * Maybe splitting this into database and cookie part ?
  *
  * @param $user_id
  */
 public static function setRememberMeInDatabaseAndCookie($user_id)
 {
     // generate 64 char random string
     $random_token_string = hash('sha256', mt_rand());
     // write that token into database
     $user = UserModel::getPublicProfileOfUser($user_id);
     $user->setUserRememberMeToken($random_token_string);
     $user->save();
     // generate cookie string that consists of user id, random string and combined hash of both
     $cookie_string_first_part = $user_id . ':' . $random_token_string;
     $cookie_string_hash = hash('sha256', $cookie_string_first_part);
     $cookie_string = $cookie_string_first_part . ':' . $cookie_string_hash;
     // set cookie
     setcookie('remember_me', $cookie_string, time() + Config::get('COOKIE_RUNTIME'), Config::get('COOKIE_PATH'));
 }
开发者ID:KyleGoslan,项目名称:Huge-Propel,代码行数:21,代码来源:LoginModel.php

示例4: foreach

                </tr>
                </thead>
                <tbody>
                    <?php 
    foreach ($res as $note) {
        ?>
                        <tr>
                            <td><?php 
        echo $note->note_id;
        ?>
</td> 
			    <td><a href="<?php 
        echo Config::get('URL') . "profile/showProfile/" . $note->user_id;
        ?>
"><?php 
        echo UserModel::getPublicProfileOfUser($note->user_id)->user_name;
        ?>
</a></td>
			    <td><?php 
        echo htmlentities($note->note_text);
        ?>
</td>
                            <td><a href="<?php 
        echo Config::get('URL') . 'note/delete/' . $note->note_id;
        ?>
">Delete</a></td>
                        </tr>
                    <?php 
    }
    ?>
                </tbody>
开发者ID:alexanderkjackson-eagles,项目名称:application,代码行数:31,代码来源:index.php

示例5:

	 <tr>
	 <td><?php 
    echo $class->class_id;
    ?>
</td>
	 <td><?php 
    echo $class->class_name;
    ?>
</td>
	 <td><?php 
    echo $class->num_paragraphs;
    ?>
</td>
	 <td><?php 
    echo $class->class_key;
    ?>
</td>
	 <td><?php 
    echo UserModel::getPublicProfileOfUser($class->instructor_id)->user_name;
    ?>
</td>
	 </tr>
 <?php 
}
?>
 </table>
  <input type="submit">
</form>
	</div>
</div>
开发者ID:alexanderkjackson-eagles,项目名称:application,代码行数:30,代码来源:classList.php


注:本文中的UserModel::getPublicProfileOfUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。