protected function findModel($id)
 {
     if (($model = Element::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #2
0
 public static function editField($id, $name, $value)
 {
     $setting = Element::findOne($id);
     $setting->{$name} = $value;
     $setting->save();
 }