gdpr-cookie-compliance
Last commit date
controllers
5 years ago
dist
5 years ago
gdpr-modules
5 years ago
languages
5 years ago
views
5 years ago
class-gdpr-modules-view.php
5 years ago
class-gdpr-modules.php
5 years ago
class-gdpr-view.php
5 years ago
class-moove-gdpr-actions.php
5 years ago
class-moove-gdpr-content.php
5 years ago
class-moove-gdpr-options.php
5 years ago
gdpr-functions.php
5 years ago
moove-gdpr.php
5 years ago
readme.txt
5 years ago
class-gdpr-view.php
40 lines
| 1 | <?php |
| 2 | /** |
| 3 | * GDPR_View File Doc Comment |
| 4 | * |
| 5 | * @category GDPR_View |
| 6 | * @package gdpr-cookie-compliance |
| 7 | * @author Gaspar Nemes |
| 8 | */ |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } // Exit if accessed directly |
| 13 | |
| 14 | /** |
| 15 | * GDPR_View Class Doc Comment |
| 16 | * |
| 17 | * @category Class |
| 18 | * @package GDPR_View |
| 19 | * @author Gaspar Nemes |
| 20 | */ |
| 21 | class GDPR_View { |
| 22 | /** |
| 23 | * Load and update view |
| 24 | * |
| 25 | * Parameters: |
| 26 | * |
| 27 | * @param string $view // the view to load, dot used as directory separator, no file extension given. |
| 28 | * @param mixed $content // The data to display in the view (could be anything, even an object). |
| 29 | */ |
| 30 | public static function load( $view, $content ) { |
| 31 | $view_file_origin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'views'; |
| 32 | $view_name = str_replace( '.', DIRECTORY_SEPARATOR, $view ) . '.php'; |
| 33 | if ( file_exists( $view_file_origin . DIRECTORY_SEPARATOR . $view_name ) ) : |
| 34 | ob_start(); |
| 35 | include $view_file_origin . DIRECTORY_SEPARATOR . $view_name; |
| 36 | return ob_get_clean(); |
| 37 | endif; |
| 38 | } |
| 39 | } |
| 40 |