本文整理汇总了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));
}
示例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"));
}
}
示例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();
}
示例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();
}
?>
示例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';