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


PHP Model_User::find_by_id方法代码示例

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


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

示例1: author

 /**
  * 返回帖子创建泽
  *
  * @return Model_User
  */
 public function author()
 {
     if (is_null($this->_author)) {
         $this->_author = Model_User::find_by_id($this->author_id);
     }
     return $this->_author;
 }
开发者ID:creat2012,项目名称:hustoj_official,代码行数:12,代码来源:Topic.php

示例2: before

	public function before()
	{
		parent::before();
		$this->template->logged_in = Tweet::instance()->logged_in();
		
		if ($this->template->logged_in)
		{
			$this->template->user = Model_User::find_by_id(Session::get('user_id'));
		}
	}
开发者ID:ntulip,项目名称:scrapyrd,代码行数:10,代码来源:scraps.php

示例3: action_del

 public function action_del()
 {
     // ban it forever, just mark it
     $user_id = $this->request->param('id', null);
     $user = Model_User::find_by_id($user_id);
     $user->defunct = Model_User::DEFUNCT_YES;
     $user->save();
     //TODO: use ajax
     $this->action_index();
 }
开发者ID:creat2012,项目名称:hustoj_official,代码行数:10,代码来源:User.php

示例4: action_send

 public function action_send()
 {
     if ($this->request->is_post()) {
         $user_id = $this->get_post('receiver', null);
         $receiver = Model_User::find_by_id($user_id);
         if ($receiver) {
             $title = $this->get_post('title', 'no title');
             $content = $this->get_raw_post('content', 'no content');
             $mail = new Model_Mail();
             $mail->from_user = $this->current_user->user_id;
             $mail->to_user = $receiver->user_id;
             $mail->content = $content;
             $mail->title = $title;
             $mail->save();
             $this->redirect('/mail/outbox');
         } else {
             $message = __('common.:user_not_found', array(':user' => $user_id));
             throw new Exception_Page($message);
         }
     }
 }
开发者ID:creat2012,项目名称:hustoj_official,代码行数:21,代码来源:Mail.php

示例5:

							<li class="<?php 
        echo Uri::segment(2) == $section_segment ? 'active' : '';
        ?>
">
								<?php 
        echo Html::anchor('site/' . $section_segment, $section_title);
        ?>
							</li>
							<?php 
    }
    ?>
				</ul>
				<ul class="nav navbar-nav pull-right">
					<li class="dropdown">
						<a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php 
    echo Model_User::find_by_id($current_user->id)->fullname;
    ?>
 <b class="caret"></b></a>
						<ul class="dropdown-menu">
							<li><?php 
    echo Html::anchor('site/users/view/' . $current_user->id, 'My Profile');
    ?>
</li>
							<li><?php 
    echo Html::anchor('site/logout', 'Logout');
    ?>
</li>
						</ul>
					</li>
				</ul>
			</div>
开发者ID:xXLXx,项目名称:ddc,代码行数:31,代码来源:template.php

示例6: allow_view_code

 /**
  * @param Model_User|string $user
  *
  * @return bool
  */
 public function allow_view_code($user)
 {
     if (is_string($user)) {
         $user = Model_User::find_by_id($user);
     }
     //        if ( $user->user_id == $this->user_id ) return true;
     if ($user->can_view_code($this)) {
         return true;
     }
     return false;
 }
开发者ID:creat2012,项目名称:hustoj_official,代码行数:16,代码来源:Solution.php

示例7: get_user_types

 public static function get_user_types($user = null)
 {
     $userTypes = [];
     if (!$user) {
         $user = Model_User::find_by_id(Auth::get('id'));
     }
     foreach (Config::get('simpleauth')['groups'] as $userIdx => $userType) {
         if ($userIdx <= $user->group) {
             $userTypes[$userIdx] = $userType['name'];
         }
     }
     return $userTypes;
 }
开发者ID:xXLXx,项目名称:ddc,代码行数:13,代码来源:user.php


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