コード例 #1
0
ファイル: OwnerSearch.php プロジェクト: kentuck13/blog-yii2
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Owner::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'slogan', $this->slogan])->andFilterWhere(['like', 'logo', $this->logo])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'b_img', $this->b_img]);
     return $dataProvider;
 }
コード例 #2
0
ファイル: main.php プロジェクト: kentuck13/blog-yii2
    <?php 
$this->head();
?>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <script src="/js/jquery.min.js"></script>
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!--[if lt IE 9]>
    <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
    <![endif]-->
</head>
<body>
<?php 
$this->beginBody();
$modelOwner = Owner::find()->one();
?>
<img src="/admin/images/owner/<?php 
echo $modelOwner->b_img;
?>
" alt="" id="bannerImg" class="hidden">

<div class="win_black"></div>
<div class="modal fade" id="ask" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title text-center" id="myModalLabel">Хотите задать вопрос ?</h4>
            </div>
コード例 #3
0
 /**
  * Finds the Owner model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Owner the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Owner::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }