Admin
3 weeks ago
Builder
3 weeks ago
Helpers
3 weeks ago
Integrations
3 weeks ago
UsageTracking
3 weeks ago
CFF_Autolink.php
3 weeks ago
CFF_Blocks.php
3 weeks ago
CFF_Cache.php
3 weeks ago
CFF_Education.php
3 weeks ago
CFF_Elementor_Base.php
3 weeks ago
CFF_Elementor_Widget.php
3 weeks ago
CFF_Error_Reporter.php
3 weeks ago
CFF_FB_Settings.php
3 weeks ago
CFF_Feed_Elementor_Control.php
3 weeks ago
CFF_Feed_Locator.php
3 weeks ago
CFF_Feed_Pro.php
3 weeks ago
CFF_GDPR_Integrations.php
3 weeks ago
CFF_Group_Posts.php
3 weeks ago
CFF_HTTP_Request.php
3 weeks ago
CFF_Oembed.php
3 weeks ago
CFF_Parse.php
3 weeks ago
CFF_Resizer.php
3 weeks ago
CFF_Response.php
3 weeks ago
CFF_Shortcode.php
3 weeks ago
CFF_Shortcode_Display.php
3 weeks ago
CFF_SiteHealth.php
3 weeks ago
CFF_Utils.php
3 weeks ago
CFF_View.php
3 weeks ago
Custom_Facebook_Feed.php
3 weeks ago
Email_Notification.php
3 weeks ago
Platform_Data.php
3 weeks ago
SB_Facebook_Data_Encryption.php
3 weeks ago
SB_Facebook_Data_Manager.php
3 weeks ago
index.php
3 weeks ago
CFF_View.php
51 lines
| 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 |