Skip to content

Commit

Permalink
feat: make svg() work with pagefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jan 31, 2024
1 parent 852ea50 commit c21ea10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2207,6 +2207,8 @@ public function styles($name = 'main', $cssDir = null)
*/
public function svg($filename, $replacements = [])
{
if ($filename instanceof Pagefiles) $filename = $filename->first()->filename;
elseif ($filename instanceof Pagefile) $filename = $filename->filename;
$filename = $this->getFile($filename);
if (!is_file($filename)) return;
// we use file_get_contents because $files->render can cause parse errors
Expand Down

0 comments on commit c21ea10

Please sign in to comment.