HEX
Server: Apache
System: Linux 3b2f6704f3ac 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64
User: (2182)
PHP: 7.4.33
Disabled: proc_open, passthru, escapeshellcmd, exec, shell_exec, system, ini_alter, dl, popen, php_check_syntax, show_source, highlight_file, symlink, link, openlog, apache_child_terminate
Upload Files
File: /home/defaultwebsite/public/wp-content/plugins/custom-facebook-feed/inc/CFF_View.php
<?php
/**
 * Class CFF_View
 *
 * This class loads view page template files on the admin dashboard area.
 *
 * @since 4.0
 */
namespace CustomFacebookFeed;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

class CFF_View {

	/**
	 * Base file path of the templates
     * 
     * @since 4.0
	 */
	const BASE_PATH = CFF_PLUGIN_DIR . 'admin/views/';

	public function __construct() {
	}

	/**
	 * Render template
	 *
	 * @param string $file
	 * @param array $data
     * 
     * @since 4.0
	 */
	public static function render( $file, $data = array() ) {
		$file = str_replace( '.', '/', $file );
		$file = self::BASE_PATH . $file . '.php';

		if ( file_exists( $file ) ) {
            if ( $data !== null && ! empty( $data ) ) extract( $data );
			include_once $file;
		}
	}
}