Commit 92fb47d2 authored by Shakarim Sapa's avatar Shakarim Sapa

- Изменен алгоритм формирования пути для сохранения файла

parent bb22ac31
......@@ -68,6 +68,7 @@ class AnalyticsSchoolCourse extends \common\components\ActiveRecordModel
// Если валидация неуспешная, возвращаем false
return false;
if (!is_null($this->image))
// Удалили старый файл перед загрузкой нового
$this->deleteFile();
......@@ -108,7 +109,7 @@ class AnalyticsSchoolCourse extends \common\components\ActiveRecordModel
* @return bool
*/
public function deleteFile(){
$filepath = Yii::getAlias('@frontend').DIRECTORY_SEPARATOR.'web'.$this->image;
$filepath = Yii::getAlias('@frontend').'/'.'web'.$this->image;
if (file_exists($filepath)) {
return unlink($filepath);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment