Admin
4 years ago
Builder
4 years ago
Helpers
5 years ago
CFF_Autolink.php
5 years ago
CFF_Blocks.php
4 years ago
CFF_Cache.php
4 years ago
CFF_Education.php
5 years ago
CFF_Elementor_Base.php
4 years ago
CFF_Elementor_Widget.php
4 years ago
CFF_Error_Reporter.php
4 years ago
CFF_FB_Settings.php
4 years ago
CFF_Feed_Elementor_Control.php
4 years ago
CFF_Feed_Locator.php
4 years ago
CFF_Feed_Pro.php
4 years ago
CFF_GDPR_Integrations.php
4 years ago
CFF_Group_Posts.php
5 years ago
CFF_HTTP_Request.php
4 years ago
CFF_Oembed.php
5 years ago
CFF_Parse.php
4 years ago
CFF_Resizer.php
4 years ago
CFF_Response.php
4 years ago
CFF_Shortcode.php
4 years ago
CFF_Shortcode_Display.php
4 years ago
CFF_SiteHealth.php
4 years ago
CFF_Utils.php
4 years ago
CFF_View.php
4 years ago
Custom_Facebook_Feed.php
4 years ago
CFF_View.php
41 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class CFF_View |
| 4 | * |
| 5 | * This class loads view page template files on the admin dashboard area. |
| 6 | * |
| 7 | * @since 4.0 |
| 8 | */ |
| 9 | namespace CustomFacebookFeed; |
| 10 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 | |
| 12 | class CFF_View { |
| 13 | |
| 14 | /** |
| 15 | * Base file path of the templates |
| 16 | * |
| 17 | * @since 4.0 |
| 18 | */ |
| 19 | const BASE_PATH = CFF_PLUGIN_DIR . 'admin/views/'; |
| 20 | |
| 21 | public function __construct() { |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Render template |
| 26 | * |
| 27 | * @param string $file |
| 28 | * @param array $data |
| 29 | * |
| 30 | * @since 4.0 |
| 31 | */ |
| 32 | public static function render( $file, $data = array() ) { |
| 33 | $file = str_replace( '.', '/', $file ); |
| 34 | $file = self::BASE_PATH . $file . '.php'; |
| 35 | |
| 36 | if ( file_exists( $file ) ) { |
| 37 | if ( $data !== null && ! empty( $data ) ) extract( $data ); |
| 38 | include_once $file; |
| 39 | } |
| 40 | } |
| 41 | } |