Difference between #10 and #12 of
"safe" and "unsafe" Model validators (massive assignments)

Changes

Title unchanged

"safe" and "unsafe" Model validators (massive assignments)

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

safe, unsafe, validators, scenarios, model

Content changed

[...]
$model = new Article;
$isblacklist = false;
}

if (isset($_POST['Article'])) {
$model->attributes =
isset($_POST['Article'];
if ($model->validate()) {
$model->save(false)
} else {
if ($isblacklist) $model->addError('text_user_input','Are you an ambitious hacker eh?');
}
[...]
2 2
7 followers
Viewed: 36 427 times
Version: 1.1
Category: How-tos
Last updated by: brianvu
Created on: Jul 13, 2013
Last updated: 7 years ago
Update Article

Revisions

View all history