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


PHP date::Now方法代碼示例

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


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

示例1: register

 /**
  * Enregistrement d'un utilisateur.
  *
  * @return  void
  */
 public function register()
 {
     if (Auth::instance()->logged_in()) {
         return url::redirect(cookie::get('urlAdminUrl') . '?msg=' . urlencode(Kohana::lang('logger.identify')));
     } elseif ($_POST) {
         $username = $this->input->post('username');
         $password = $this->input->post('password');
         $tmpUsername = explode('@', $username);
         $tmpUsername = $tmpUsername[0];
         $user = ORM::factory('user', $username);
         if (!$username || !$password) {
             $txt = Kohana::lang('logger.error_all_form');
         } elseif (!valid::email($username) || !valid::email_domain($username) || !valid::email_rfc($username)) {
             $txt = Kohana::lang('logger.error_mail_valid');
         } elseif (User_Model::verification_mail($username)) {
             $txt = Kohana::lang('logger.exist_email');
         } elseif ($user->loaded) {
             $txt = Kohana::lang('logger.exist_username');
         } elseif ($user->insert(array('username' => $tmpUsername, 'x' => Kohana::config('game.initialPosition.x'), 'y' => Kohana::config('game.initialPosition.y'), 'z' => Kohana::config('game.initialPosition.z'), 'region_id' => Kohana::config('game.initialPosition.region'), 'speed' => Kohana::config('game.initialSpeed'), 'gravity' => Kohana::config('game.initialGravity'), 'password' => Auth::instance()->hash_password($password), 'last_login' => date::Now(), 'argent' => 0, 'hp' => Kohana::config('game.initialHP'), 'hp_max' => Kohana::config('game.initialHP'), 'email' => $username, 'ip' => $_SERVER['REMOTE_ADDR']))) {
             Auth::instance()->login($username, $password);
             $from = Kohana::config('game.name') . ' <' . Kohana::config('email.from') . '>';
             $subject = Kohana::lang('logger.title_mail_register', Kohana::config('game.name'));
             $message = Kohana::lang('logger.content_mail_register', $username, $username, $password);
             email::send($username, $from, $subject, $message, TRUE);
             return url::redirect('?msg=' . urlencode(Kohana::lang('logger.identify')));
         } else {
             $txt = Kohana::lang('logger.error_register');
         }
     } else {
         $txt = Kohana::lang('logger.no_acces');
     }
     return self::redirection($txt);
 }
開發者ID:ezioms,項目名稱:RpgEditor,代碼行數:38,代碼來源:logger.php


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