getPath() public method

Provides the path of the resource.
public getPath ( ) : string
return string The path of the resource.
Exemplo n.º 1
0
 public function it_gets_theme_path(OutputSettingsIssue $issueOutput, Resource $resource)
 {
     $resource->getPath()->willReturn('publication_1/theme_1/');
     $issueOutput->getThemePath()->willReturn($resource);
     $this->getThemePath()->shouldReturn('publication_1/theme_1/');
 }
 public function getPath()
 {
     $this->__load();
     return parent::getPath();
 }
 /**
  * Internal method, get the full path from an resource.
  *
  * @param Resource $resource
  * @return string
  */
 protected function getResourceFullPath(Resource $resource)
 {
     return $resource->getPath();
 }
 /**
  * Provides the relative path of the resource based on the provided theme path.
  * This method also checks if the resource path is compatible with the theme path
  * meaning that the resource needs to be placed in the theme.
  *
  * @param Resource $rsc
  * 		The resource to extract the relative path from, not null.
  * @param string $themePath
  * 		The theme path, not null.
  * @throws Exception
  * 		In case the resource does not belong to the theme.
  * @return string
  * 		The relative [path in regards with the theme path for the resource.
  */
 protected function getRelativePath(Resource $rsc, $themePath)
 {
     $path = $rsc->getPath();
     $lenght = strlen($themePath);
     if (strncmp($path, $themePath, $lenght) != 0) {
         throw new \Exception("The resource path '.{$path}.' is not for the provided theme path '.{$themePath}.'.");
     }
     $path = substr($path, $lenght);
     return $path;
 }