/**
  *
  * @param usersData $data
  * @return type 
  */
 public function updateTutorial($data)
 {
     $userModel = new Users();
     $tutorialModel = new Tutorial();
     $user = $userModel->getUserById($data->id);
     $tutorialId = $user->attributes['tutorial_id'];
     $tutorialModel->unsetAttributes();
     $result = $tutorialModel->updateByPk($tutorialId, $data->tutorials);
     $body = $this->renderPartial('tutorial/result', array('format' => $data->format, 'result' => $result), true);
     return $this->response->type('json')->goodResponse($body);
 }
Exemplo n.º 2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Tutorial('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Tutorial'])) {
         $model->attributes = $_GET['Tutorial'];
     }
     $this->render('admin', array('model' => $model));
 }