WIP : Upload management
This commit is contained in:
@@ -25,4 +25,48 @@ class CategoryImage extends BaseCategoryImage
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get picture absolute path
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getAbsolutePath()
|
||||
{
|
||||
return null === $this->file
|
||||
? null
|
||||
: $this->getUploadRootDir().'/'.$this->file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get picture web path
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getWebPath()
|
||||
{
|
||||
return null === $this->file
|
||||
? null
|
||||
: $this->getUploadDir().'/'.$this->file;
|
||||
}
|
||||
|
||||
/**
|
||||
* The absolute directory path where uploaded
|
||||
* documents should be saved
|
||||
* @return string
|
||||
*/
|
||||
protected function getUploadRootDir()
|
||||
{
|
||||
return __DIR__.'/../../../../../'.$this->getUploadDir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rid of the __DIR__ so it doesn't screw up
|
||||
* when displaying uploaded doc/image in the view.
|
||||
* @return string
|
||||
*/
|
||||
protected function getUploadDir()
|
||||
{
|
||||
return 'local/media/images/category';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user