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


PHP Registration::validate方法代碼示例

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


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

示例1: actionRegister

 public function actionRegister()
 {
     $formModel = new Registration();
     //$this->performAjaxValidation($formModel);
     if (isset($_POST['Registration'])) {
         $formModel->email = $_POST['Registration']['email'];
         $formModel->username = $_POST['Registration']['username'];
         $formModel->password = $_POST['Registration']['password'];
         $formModel->password_repeat = $_POST['Registration']['password_repeat'];
         $formModel->verification_code = $_POST['Registration']['verification_code'];
         if ($formModel->validate()) {
             $model = new User();
             if ($model->insert(CassandraUtil::uuid1(), array('email' => $_POST['Registration']['email'], 'username' => $_POST['Registration']['username'], 'password' => User::encryptPassword($_POST['Registration']['password']), 'active' => false, 'blocked' => false)) === true) {
                 echo 'Model email ' . $formModel->email . ' && username ' . $formModel->username;
                 if (!User::sendRegisterVerification($formModel->email, $formModel->username)) {
                     echo 'failed';
                 } else {
                     echo 'done';
                 }
                 die;
                 //$this->redirect(array('user/profile'));
             }
         }
     }
     $this->render('register', array('model' => $formModel));
 }
開發者ID:redlaw,項目名稱:lintinzone,代碼行數:26,代碼來源:RegistrationController.php

示例2: actionRegister

    public function actionRegister() {
        $this->layout = '//layouts/login_main';
        if (!isFrontUserLoggedIn()) {
            $model = new Registration;

            if (isset($_POST['Registration'])) {
                $model->attributes = $_POST['Registration'];
                $model->country = "USA";
                if ($model->validate()) {
                    $model->password = md5($model->password);
                    $model->confirm_password = $model->password;
                    $model->save();
                    $this->redirect(base_url() . '/user/default/login');
                }
            }
            $this->render('register', array('model' => $model));
        } else {
            $this->redirect(array("myaccount"));
        }
    }
開發者ID:priyranjansingh,項目名稱:donation,代碼行數:20,代碼來源:DefaultController.php

示例3: store_registrations

 public function store_registrations()
 {
     if ($this->isPostRequest()) {
         $input_data = Input::all();
         // input all data
         $model = new Registration();
         //save data into
         if ($model->validate($input_data)) {
             DB::beginTransaction();
             try {
                 $model->create($input_data);
                 DB::commit();
                 Session::flash('message', 'Successfully Registered ! We will call you back soon.');
             } catch (Exception $e) {
                 //If there are any exceptions, rollback the transaction`
                 DB::rollback();
                 Session::flash('danger', 'Failed !');
             }
         }
     } else {
         Session::flash('danger', 'Invalid Request !');
     }
     return Redirect::back();
 }
開發者ID:selimppc,項目名稱:ecies,代碼行數:24,代碼來源:HomeController.php

示例4: Registration

<?php

echo "Success";
include_once '../controller/validateRegister.php';
include_once '../model/connect.php';
//include_once 'php/insertion.php';
if (isset($_POST['submit'])) {
    $r = new Registration();
    $r->validate();
    $r->addUser();
}
?>

開發者ID:kapsi44,項目名稱:UMS,代碼行數:12,代碼來源:success.php

示例5: stdClass

<?php

$view = new stdClass();
$view->pageTitle = 'Registration';
require_once 'Models/Registration.php';
if (isset($_POST['email'])) {
    $registration = new Registration();
    $validator = $registration->validate($_POST);
    if ($validator !== true) {
        $view->error = $validator;
    }
}
require_once 'Views/registration.phtml';
開發者ID:Alvarts,項目名稱:ssp,代碼行數:13,代碼來源:registration.php


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