-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Short description of the issue
I find myself very often converting paths to urls and vice versa. For example today I had to deal with it when using MPDF library and file field items.
Expected behavior
It would be great to have an easy and fool proof solution to convert relative urls to paths and paths to relative urls.
Actual behavior
At the moment we need to do complicated string concatenations that are even error prone (for example when one does not think of different directory separators on different platforms or installations in subfolders). See my related PR here: processwire/processwire#143
Examples of possible API implementation
$url = $pages->get(123)->mypdf->url;
// eg /site/assets/files/123/myfile.pdf
$path = $config->path($url);
// eg /var/www/mysite/site/assets/files/123/myfile.pdf
$url = $config->url($path);
// again /site/assets...
thetuningspoon, szabeszg, gadgetto, jmartsch and elabxethanbeyer
Metadata
Metadata
Assignees
Labels
No labels