コード例 #1
0
    public function actionIndex() {

        $this->pageTitle = 'Фотографии';

        $model = new OrgsImages('search');
        $model->unsetAttributes();  // clear any default values

        if(isset($_GET['OrgsImages']))
            $model->attributes=$_GET['OrgsImages'];
 
        $dataProvider = $model->search();
        $dataProvider->pagination->pageSize = 25;


        $this->render('index',array(
            'model'=>$model, 
            'model_search'=>$dataProvider
        ));
    }
コード例 #2
0
ファイル: _grid_photo.php プロジェクト: Aplay/Fastreview_site
<?php
$src = Yii::app()->createAbsoluteUrl('/file/file/company',array('id'=>$data->id));
echo CHtml::link(CHtml::image($src,'',array('style'=>'width:155px;height:auto;')), $src ,array('data-lightbox'=>'lb-'.$data->id));

OrgsImages::model()->updateByPk($data->id,array('verified'=>1));
?>
               
コード例 #3
0
ファイル: User.php プロジェクト: Aplay/Fastreview_site
     protected function beforeDelete(){
        if(!parent::beforeDelete())
            return false;

        OrgsImages::model()->updateAll(array('uploaded_by'=>null),array('condition'=>'uploaded_by='.$this->id));
        Orgs::model()->updateAll(array('author'=>null),array('condition'=>'author='.$this->id));

        $this->deleteModelDir(); // удалили модель? удаляем и файл и всю папку
        return true;
    }