PluginProbe
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress / trunk
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress vtrunk
4.12.0 4.10.0 4.9.0 4.8.1 trunk 1.0 1.1 1.12.1 1.2.3 1.2.4 1.2.5 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 All 171 releases
custom-facebook-feed / inc / CFF_View.php
CFF_View.php
51 lines 771 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class CFF_View
5 *
6 * This class loads view page template files on the admin dashboard area.
7 *
8 * @since 4.0
9 */
10
11 namespace CustomFacebookFeed;
12
13 if (! defined('ABSPATH')) {
14 exit; // Exit if accessed directly
15 }
16
17 class CFF_View
18 {
19 /**
20 * Base file path of the templates
21 *
22 * @since 4.0
23 */
24 const BASE_PATH = CFF_PLUGIN_DIR . 'admin/views/';
25
26 public function __construct()
27 {
28 }
29
30 /**
31 * Render template
32 *
33 * @param string $file
34 * @param array $data
35 *
36 * @since 4.0
37 */
38 public static function render($file, $data = array())
39 {
40 $file = str_replace('.', '/', $file);
41 $file = self::BASE_PATH . $file . '.php';
42
43 if (file_exists($file)) {
44 if ($data !== null && ! empty($data)) {
45 extract($data);
46 }
47 include_once $file;
48 }
49 }
50 }
51