Pimcore\Model\Asset::getFullPath PHP Method

getFullPath() public method

Returns the full path of the document including the filename
public getFullPath ( ) : string
return string
    public function getFullPath()
    {
        $path = $this->getPath() . $this->getFilename();
        if (\Pimcore\Tool::isFrontend()) {
            $path = urlencode_ignore_slash($path);
            $results = \Pimcore::getEventManager()->trigger("frontend.path.asset", $this);
            if ($results->count()) {
                $path = $results->last();
            }
        }
        return $path;
    }

Usage Example

Example #1
0
 /**
  * @param string $name
  * @return DAV\INode|void
  * @throws DAV\Exception\NotFound
  */
 function getChild($name)
 {
     $nameParts = explode("/", $name);
     $name = File::getValidFilename($nameParts[count($nameParts) - 1]);
     //$name = implode("/",$nameParts);
     if (is_string($name)) {
         $parentPath = $this->asset->getFullPath();
         if ($parentPath == "/") {
             $parentPath = "";
         }
         if (!($asset = Asset::getByPath($parentPath . "/" . $name))) {
             throw new DAV\Exception\NotFound('File not found: ' . $name);
         }
     } else {
         if ($name instanceof Asset) {
             $asset = $name;
         }
     }
     if ($asset instanceof Asset) {
         if ($asset->getType() == "folder") {
             return new Asset\WebDAV\Folder($asset);
         } else {
             return new Asset\WebDAV\File($asset);
         }
     }
     throw new DAV\Exception\NotFound('File not found: ' . $name);
 }
All Usage Examples Of Pimcore\Model\Asset::getFullPath