Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Kitaplar::find();
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['kitap_id' => $this->kitap_id, 'kategori_id' => $this->kategori_id, 'sayfa_sayisi' => $this->sayfa_sayisi, 'kullanci_id' => $this->kullanci_id]);
     $query->andFilterWhere(['like', 'yazar_adi', $this->yazar_adi])->andFilterWhere(['like', 'kitap_adi', $this->kitap_adi])->andFilterWhere(['like', 'yayinevi', $this->yayinevi]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getKitap()
 {
     return $this->hasOne(Kitaplar::className(), ['kitap_id' => 'kitap_id']);
 }
Ejemplo n.º 3
0
 /**
  * Finds the Kitaplar model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Kitaplar the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Kitaplar::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 4
0
use rmznclk71\kitap\models\Kitaplar;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\modules\admin\models\Okuyacakkitap */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="okuyacakkitap-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'kitap_id')->dropDownList(ArrayHelper::map(Kitaplar::find()->all(), 'kitap_id', 'kitap_adi'), ['prompt' => 'Kitap Seçiniz ..']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Ekle' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Ejemplo n.º 5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getKitaplars()
 {
     return $this->hasMany(Kitaplar::className(), ['kategori_id' => 'id']);
 }