Skip to content

Commit

Permalink
feat: add variables array to view() method
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Dec 22, 2023
1 parent da8f25b commit c98ee66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1866,10 +1866,10 @@ protected function renderFileTwig($file, $vars)
/**
* Get markup of a single view file
*/
public function ___view(string $file): Html|string
public function ___view(string $file, array $vars = []): Html|string
{
$file = $this->viewFile($file);
$markup = $this->render($file);
$markup = $this->render($file, $vars);
return $this->html($markup);
}

Expand Down Expand Up @@ -1923,7 +1923,7 @@ public function viewFolders(array $folders, array $options = []): Html|string
$this->viewTrailingSlash($opt->trailingslash);

// remove all styles that have been added to the main styles array
// this is because the mail style array is for the main website
// this is because the main style array is for the main website
// and we usually don't need it for custom frontends
if ($opt->removeMainStyles) $this->styles('main')->removeAll();

Expand Down

0 comments on commit c98ee66

Please sign in to comment.