当前位置: 首页>>代码示例>>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;未经允许,请勿转载。