1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<?php
namespace hji\ResponsiveIDX\utils;
use \hji\membership\Membership;
use \hji\common\utils\View as BaseView;
use hji\ResponsiveIDX\ResponsiveIDX;
class View
{
protected $vars = false;
public function set($name, $value)
{
$this->vars[$name] = $value;
}
public function get($name)
{
return (isset($this->vars[$name])) ? $this->vars[$name] : null;
}
public function render($fileName, $vars = false)
{
if (!class_exists('\hji\membership\Membership'))
{
return;
}
$viewPath = locate_template($fileName . '.phtml');
if ($viewPath == '')
{
$viewPath = ResponsiveIDX::$views . '/' . $fileName . '.phtml';
}
$vars = ($vars) ? $vars : $this->vars;
return BaseView::render($viewPath, $vars);
}
}