| Server IP : 5.129.245.98 / Your IP : 216.73.216.246 Web Server : Apache/2.4.66 (Debian) System : Linux 1b8c17c336b9 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/plugins/rehub-framework/vendor/vafpress/classes/ |
Upload File : |
<?php
/**
* A Singleton class for loading view template
*/
class VP_View
{
/**
* Singleton instance of the class
* @var Option_View
*/
private static $_instance;
private $_views;
private function __construct()
{
$this->_views = array();
}
public static function instance()
{
if (is_null(self::$_instance))
{
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Load view file
* @param String $field_view_file Name of the view file
* @param Array $data Array of data to be binded on the view
* @return String The result view
*/
public function load($field_view_file, $data = array())
{
if (array_key_exists('field_view_file', $data))
{
throw new Exception("Sorry 'field_view_file' variable name can't be used.");
}
$view_file = VP_FileSystem::instance()->resolve_path('views', $field_view_file);
if($view_file === false)
{
throw new Exception("View file not found.");
}
extract($data);
ob_start();
include $view_file;
return ob_get_clean();
}
}
/**
* EOF
*/