本文整理汇总了PHP中Registration::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::unsetAttributes方法的具体用法?PHP Registration::unsetAttributes怎么用?PHP Registration::unsetAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::unsetAttributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionRegistration
public function actionRegistration()
{
$model = new Registration();
$model->unsetAttributes();
$model->attributes = $this->aRequest('Registration');
$this->renderPartial('registration', array('model' => $model));
}
示例2: actionCompetitions
public function actionCompetitions()
{
$model = new Registration();
$model->unsetAttributes();
$model->user_id = $this->user->id;
$this->render('competitions', array('model' => $model));
}
示例3: actionCompetitors
public function actionCompetitors()
{
$competition = $this->getCompetition();
$model = new Registration('search');
$model->unsetAttributes();
$model->competition_id = $competition->id;
$model->status = Registration::STATUS_ACCEPTED;
$this->render('competitors', array('model' => $model, 'competition' => $competition));
}
示例4: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Registration('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Registration'])) {
$model->attributes = $_GET['Registration'];
}
$this->render('admin', array('model' => $model));
}
示例5: actionPreviewNotice
public function actionPreviewNotice()
{
$id = $this->iGet('id');
$competition = Competition::model()->findByPk($id);
if ($competition === null) {
throw new CHttpException(404, '未知比赛ID');
}
if ($this->user->isOrganizer() && !isset($competition->organizers[$this->user->id])) {
throw new CHttpException(403, '权限不足');
}
$competition->formatEvents();
$registration = new Registration();
$registration->unsetAttributes();
$registration->competition_id = $id;
$model = new SendNoticeForm();
if (isset($_POST['SendNoticeForm'])) {
$model->attributes = $_POST['SendNoticeForm'];
}
echo json_encode($model->getPreview($competition));
}