HEX
Server: LiteSpeed
System: Linux premium221.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: madepabj (2566)
PHP: 8.3.26
Disabled: NONE
Upload Files
File: //home/madepabj/public_html/wp-content/plugins/rehub-framework/vendor/vafpress/classes/view.php
<?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
 */