Commit bb22ac31 authored by Shakarim Sapa's avatar Shakarim Sapa

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

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