public function actionUpdate($id)
 {
     $model = Storylet::findOne($id);
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $model->attributes = Yii::$app->request->post();
         $model->saveStorylet();
     }
     return $this->render('create', ['model' => $model]);
 }
Exemplo n.º 2
0
 public function run()
 {
     // $users=User::find()
     // ->indexBy('id')
     // ->all();
     $Allstorylets = Storylet::findMyMasterStorylets();
     //var_dump ($users);
     foreach ($Allstorylets as $storylet) {
         echo "- <a href=/storylet/view?id={$storylet->storylet_id}>{$storylet->storylet_name}</a><br>";
     }
     //echo "/storylet/view?id=$storylet->storylet_id>$storylet->storylet_name<br>"; }
     //echo $user->username;
     //foreach($user as $key=>$value){
     //echo $users;
 }