mirror of
https://github.com/mashirozx/sakura.git
synced 2024-11-23 07:18:12 +08:00
22 lines
455 B
PHP
22 lines
455 B
PHP
|
<?php
|
||
|
|
||
|
namespace Sakura\Routers;
|
||
|
|
||
|
use Sakura\Helpers\TemplateHelper;
|
||
|
|
||
|
class AdminRouter
|
||
|
{
|
||
|
public function __construct()
|
||
|
{
|
||
|
add_action('admin_menu', [$this, 'add_theme_page']);
|
||
|
}
|
||
|
|
||
|
public function add_theme_page()
|
||
|
{
|
||
|
add_theme_page('page_title', 'menu-title', 'edit_theme_options', 'menu-slug', function () {
|
||
|
$template = new TemplateHelper();
|
||
|
echo $template->load('admin-rouer.twig')->renderBlock('admin_app', []);
|
||
|
});
|
||
|
}
|
||
|
}
|