Brabijan\Images\ImagePipe::getPath PHP Method

getPath() public method

public getPath ( ) : string
return string
    public function getPath()
    {
        return $this->path !== NULL ? $this->path : $this->baseUrl . str_replace($this->wwwDir, '', $this->assetsDir);
    }

Usage Example

 public function createTemplate(Control $control = NULL)
 {
     if ($control === NULL) {
         $control = $this->application->presenter;
     }
     $template = $this->templateFactory->createTemplate($control);
     $template->_imagePipe = $this->imagePipe;
     $template->locale = isset($control->getPresenter()->locale) ? $control->getPresenter()->locale : NULL;
     $template->addFilter('file', function ($path) {
         return $this->imagePipe->getPath() . '/' . $path;
     });
     $template->addFilter('mangleEmail', function ($mail) {
         $parts = str_split($mail);
         $str = '';
         foreach ($parts as $item) {
             $str .= '&#' . ord($item) . ";";
         }
         return $str;
     });
     return $template;
 }