Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Code structure reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
pricop committed Apr 1, 2019
1 parent 070c91a commit bdd311a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions app/core/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ public function __construct($settings, $language, $url)
$this->url = $url;
}

/**
* @param array $data The data to be passed to the view template
* @param string $view The file path / name of the view
* @return string
*/
public function render($data = null, $view = null)
{
/**
* Start the output buffer
* This is needed to create the template inheritance
*/
ob_start();

// Do not use %_once as some of the template files may need to be called multiple times
require(sprintf('%s/../../%s/%s/views/%s.php', __DIR__, PUBLIC_PATH, THEME_PATH, $view));

return ob_get_clean();
}

/**
* @return string
*/
Expand All @@ -58,25 +77,6 @@ public function message()
return $messages;
}

/**
* @param array $data The data to be passed to the view template
* @param string $view The file path / name of the view
* @return string
*/
public function render($data = null, $view = null)
{
/**
* Start the output buffer
* This is needed to create the template inheritance
*/
ob_start();

// Do not use %_once as some of the template files may need to be called multiple times
require(sprintf('%s/../../%s/%s/views/%s.php', __DIR__, PUBLIC_PATH, THEME_PATH, $view));

return ob_get_clean();
}

/**
* @return string
*/
Expand Down

0 comments on commit bdd311a

Please sign in to comment.