Skip to content

Commit

Permalink
Add publicUrl() method
Browse files Browse the repository at this point in the history
  • Loading branch information
drmad committed May 31, 2022
1 parent 064ef9b commit 3e37424
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Vendimia\Exception\ResourceNotFoundException;

use const Vendimia\WEB_ROOT;
use const Vendimia\PUBLIC_URL;

/**
* HTML support library
Expand Down Expand Up @@ -168,6 +169,14 @@ public function addExternalScript($href, ...$attributes)
];
}

/**
* Prepends constant Vendimia\PUBLIC_URL to $url, if exists.
*/
public function publicUrl($url)
{
return PUBLIC_URL . '/' . $url;
}

/**
* Changes the layout
*/
Expand Down Expand Up @@ -269,6 +278,7 @@ public function renderMetaTags()

return join("\n", $html) . "\n";
}

/**
* Renders the <SCRIPT> tags, including local JavaScripts.
*/
Expand Down

0 comments on commit 3e37424

Please sign in to comment.