function package($args) { $package_name = array_shift($args); $package = MVC_Router::getInstance()->get_package_for($package_name); if ($package) { if (method_exists($package, 'get_permission') && !Permission::has_permission($package->get_permission())) { $this->redirect(ADMIN_URL); } $controller = $package->get_admin_controller(); define('PACKAGE_URL', $this->get_package_uri(true) . "package/{$package_name}/"); $package->set_control_dir($package->get_admin_control_dir()); $package->set_admin_defaults(); echo $package->auto_route($args); // echo call_user_func_array(array($package, $controller), $args); } }
public function __construct() { MVC_Router::getInstance()->add_library($this->get_package_dir() . 'classes'); define('ADMIN_URL', $this->get_package_uri(true)); Mvc_Fileserver::get_instance()->add_location(__DIR__ . '/public'); }
public function __construct() { MVC_Router::getInstance()->add_library($this->get_package_dir() . 'classes'); }
<?php MVC_Router::getInstance()->register_package_directory(__DIR__ . '/modules');