title="Редактирование статьи"; $this->params['breadcrumbs'][] = ['label' => 'Новости', 'url' => ['newslist']]; $this->params['breadcrumbs'][] = $this->title; if( !isset($id) ){ $request = Yii::$app->request; $id = $request->get('id'); } if( !isset($model) ){ $model = News::findOne($id); if( !$model ){ $model = new \app\models\News(); } } if( !(isset($model->uid) && $model->uid && Uuid::isvalid($model->uid)) ) { if( strlen( $model->uid ) <> 32 ) //2f58b5602dc6500d645ea6032118884e old style { $i = 100; while( $i ) { $uuid = Uuid::GetUUID(); $model->uid = $uuid; $tmp = $model->find()->andWhere(['uid'=>$uuid])->one(); if( !$tmp ) break; $i--; } } } echo $this->render('formNews', [ 'news' => $model, ]); ?>