Devise\Media\Categories\CategoryPaths::browserPath PHP Method

browserPath() public method

Browser path is the url path to this root media directory
public browserPath ( $path ) : string
$path
return string
    public function browserPath($path)
    {
        $path = $path != '' ? $path . '/' : '';
        return '/' . $this->Config->get('devise.media-manager.root-dir') . '/' . $path;
    }

Usage Example

Beispiel #1
0
 /**
  * Image url for a given category and image
  *
  * @param $input
  * @return string
  */
 public function getImageUrl($input)
 {
     $localPath = isset($input['category']) ? $this->CategoryPaths->fromDot($input['category']) : '';
     $browserPath = $this->CategoryPaths->browserPath($localPath);
     return $browserPath . $input['image'];
 }