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

Revision #11 has been created by Kostas Apazidis (KonApaz) on Jul 15, 2013, 7:15:58 PM with the memo:

"safe" and "unsafe" Model validators (massive assignments)
« previous (#10) next (#12) »

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: 37 104 times
Version: 1.1
Category: How-tos
Last updated by: brianvu
Created on: Jul 13, 2013
Last updated: 8 years ago
Update Article

Revisions

View all history