plugin_dir = $plugin_dir; $this->plugin_path = $this->get_plugins_dir() . SLASH . $this->plugin_dir . SLASH; } public function get_plugins_dir() { return ROOT_DIR . SLASH . PLAYAREA_DIR_NAME . SLASH . "plugins"; } public function template_load($name, $variables = array(), $new = true) { global $b; $plugin_template_path = $this->plugin_path . "template" . $name; return $b->template_load_by_path($plugin_template_path, $variables, $new); } public function router_add($page, $func, $methods = array("GET", "POST")) { global $b; $b->router_add($page, function () use ($func) { $func(); }, $methods); } public function get_assets_path(): string { global $b; $root = $b->router_get_root_uri(); return $root . SLASH . PLAYAREA_DIR_NAME . SLASH . 'plugins' . SLASH . $this->plugin_dir . SLASH . "assets". SLASH; } }