| 1 |
<?php |
| 2 |
|
| 3 |
namespace ImportWP\Common\UI; |
| 4 |
|
| 5 |
use ImportWP\Common\Properties\Properties; |
| 6 |
|
| 7 |
class ViewManager |
| 8 |
{ |
| 9 |
/** |
| 10 |
* @var Properties |
| 11 |
*/ |
| 12 |
private $properties; |
| 13 |
|
| 14 |
public function __construct(Properties $properties) |
| 15 |
{ |
| 16 |
$this->properties = $properties; |
| 17 |
} |
| 18 |
|
| 19 |
public function view($name, $args = array()) |
| 20 |
{ |
| 21 |
extract($args); |
| 22 |
|
| 23 |
include $this->properties->view_dir . $name . '.php'; |
| 24 |
} |
| 25 |
|
| 26 |
public function plugin_page() |
| 27 |
{ |
| 28 |
$this->view('admin'); |
| 29 |
} |
| 30 |
|
| 31 |
public function tool_box() |
| 32 |
{ |
| 33 |
$this->view('tools-card'); |
| 34 |
} |
| 35 |
} |
| 36 |
|