| 1 |
<?php |
| 2 |
class WpSaioView |
| 3 |
{ |
| 4 |
protected static $dir = ''; |
| 5 |
protected static $view_root_folder = ''; |
| 6 |
|
| 7 |
public function __construct() |
| 8 |
{ |
| 9 |
|
| 10 |
} |
| 11 |
public static function load($path, $args = array()) |
| 12 |
{ |
| 13 |
self::setDefaultValues(); |
| 14 |
|
| 15 |
if (count($args) > 0) { |
| 16 |
extract($args); |
| 17 |
} |
| 18 |
$path = self::$dir . '/' . self::$view_root_folder . '/' . str_replace('.', '/', $path) . '.php'; |
| 19 |
ob_start(); |
| 20 |
require $path; |
| 21 |
return ob_get_clean(); |
| 22 |
} |
| 23 |
protected static function setDefaultValues() |
| 24 |
{ |
| 25 |
self::$dir = WP_SAIO_DIR; |
| 26 |
self::$view_root_folder = 'views'; |
| 27 |
} |
| 28 |
} |
| 29 |
|