Commit bb22ac31 authored by Shakarim Sapa's avatar Shakarim Sapa

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

parent dcf8831a
......@@ -108,7 +108,7 @@ class AnalyticsSchoolCourse extends \common\components\ActiveRecordModel
* @return bool
*/
public function deleteFile(){
$filepath = Yii::getAlias('@frontend').$this->image;
$filepath = Yii::getAlias('@frontend').DIRECTORY_SEPARATOR.'web'.$this->image;
if (file_exists($filepath)) {
return unlink($filepath);
}
......@@ -138,8 +138,8 @@ class AnalyticsSchoolCourse extends \common\components\ActiveRecordModel
* @return string
*/
public function getPath($absolute=true, $delimiter=DIRECTORY_SEPARATOR) {
$path = $delimiter.'web'.$delimiter.(implode($delimiter, $this->save_folder));
return ($absolute===true) ? Yii::getAlias('@frontend').$path : $path;
$path = $delimiter.(implode($delimiter, $this->save_folder));
return ($absolute===true) ? Yii::getAlias('@frontend').$delimiter.'web'.$path : $path;
}
/**
......
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