src/includes/classes/Core/Utils/Route.php
public function load(array $args = [])
    {
        $default_args = [
            'path'        => '',
            'dir'         => '',
            'vars'        => [],
            'on_resolved' => null,
        ];
        $args += $default_args;

        $args['path'] = (string) $args['path'];
        $args['dir']  = (string) $args['dir'];
        $args['vars'] = (array) $args['vars'];

        if (($resolved = $this->resolve($args['path'], $args['dir'], $args))) {
            if (isset($args['on_resolved']) && is_callable($args['on_resolved'])) {
                $args['on_resolved']($resolved);
            }
            exit($this->get($resolved)->parse($args['vars']));
        } else {
            $this->c::die(404); // Unable to resolve.
        }
    }
public function load(array $args = [])
    {
        $default_args = [
            'path'        => '',
            'dir'         => '',
            'vars'        => [],
            'on_resolved' => null,
        ];
        $args += $default_args;

        $args['path'] = (string) $args['path'];
        $args['dir']  = (string) $args['dir'];
        $args['vars'] = (array) $args['vars'];

        if (($resolved = $this->resolve($args['path'], $args['dir'], $args))) {
            if (isset($args['on_resolved']) && is_callable($args['on_resolved'])) {
                $args['on_resolved']($resolved);
            }
            exit($this->get($resolved)->parse($args['vars']));
        } else {
            $this->c::die(404); // Unable to resolve.
        }
    }
Loads route file.

@since 161008 Route utilities.
@since 17xxxx Exit instead of return.

@param array $args Behavioral args.