Fix bug with undefined index 'stylepath'

This commit is contained in:
Dmitriy Simushev 2014-01-28 14:25:04 +00:00
parent 42ff39f4d9
commit 57d72e95d0

View File

@ -46,9 +46,6 @@ class PageStyle extends Style implements StyleInterface
*/
public function render($template_name, $data = array())
{
// Add template root value to page variables
$page['stylepath'] = MIBEW_WEB_ROOT . '/' . $this->filesPath();
// Prepare to output html
start_html_output();
@ -61,6 +58,9 @@ class PageStyle extends Style implements StyleInterface
// it as an alias of $data argument.
$page = $data;
// Add template root value to page variables
$page['stylepath'] = MIBEW_WEB_ROOT . '/' . $this->filesPath();
// Load and execute the view
require($full_view_name);
}