<?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)); ?>
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; }