/**
  * Lists all Contents models.
  * @return mixed
  */
 public function actionIndex($id)
 {
     $searchModel = new ContentsSearch();
     $searchModel->Document = $id;
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     Yii::$app->getUser()->setReturnUrl(Yii::$app->request->getUrl());
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * Generates printable version of Document.
  * @param integer $id
  * @return mixed
  */
 public function actionPrint($id)
 {
     $this->layout = false;
     $searchModel = new ContentsSearch();
     $searchModel->Document = $id;
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->pagination = false;
     $dataProvider->sort = false;
     return $this->render('print', ['model' => $this->findModel($id), 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }