Strata\Router\RouteParser\Url\UrlRouter

Maps Wordpress urls to Strata classes

    Synopsis

    class UrlRouter extends Router {
    • // Inherited members from Router
    • public Route $route;
    }

    Hierarchy

    Members

    private

    • $registered — boolean

    public

    Methods

    protected

    • isRegistered() — Returns whether the Wordpress event has already been added.
    • registerWordpressAction() — Registers the Wordpress action required to handle the routing at the correct timing.

    public

    • __construct()
    • addModelRoutes() — Adds customized routes to the router instance that have been defined in the custom post type's routing information.
    • addResource() — Adds possibles routes to the router instance based on Custom Post Type information.
    • addRoutes() — Adds possibles routes the router instance
    • factory() — Returns an instance of the router instantiated with the optional $routes.
    • onWordpressEarlyInit() — The callback sent to Wordpress' 'init' action. It understands the current url context and calls the current controller's method, if applicable.
    • onWordpressInit() — The callback sent to Wordpress' 'wp' action. It understands the current url context and calls the current controller's method, if applicable.

    Inherited from Strata\Router\Router

    public

    • abandonCurrent() — Abandons the current route.
    • callback() — Generates a dynamic and unique callback ready to use with Wordpress' add_action or add_filter calls.
    • getCurrentAction() — Returns the current action.
    • getCurrentController() — Returns the current controller object.
    • isAjax() — Returns whether the current request is considered being called as an Ajax query.
    • isFrontendAjax() — Attempts to decide if the current Ajax request is happening on the frontend instead of the backend.
    • run() — Attempts to run the currently loaded route object.
    • urlRouting() — Generates a parser for URL based rules, as one may be used to in the world of Model View Controller programming.