Example #1
0
 private function loadBlock()
 {
     $this->block = \yii\fluent\models\Block::findOne(['name' => $this->name])->getTranslation(Language::getCurrentLangID(), false);
 }
Example #2
0
 /**
  * Finds the Block model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Block the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Block::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }