Y.mojito.lib.MojitoRouter Class
The Routing component of Mojito.
Constructor
Y.mojito.lib.MojitoRouter
-
store
Parameters:
-
storeObjectThe resource store for the router to use.
Item Index
Methods
_matchToInternal
-
uri -
verb.
Returns a matching route for the given URI
Parameters:
-
uriStringThe uri to find a route for.
-
verb.StringThe HTTP verb for the route.
find
-
url -
verb
Finds a route for a given method+URL
Parameters:
-
urlStringthe URL to find a route for.
-
verbStringthe HTTP method.
getComputedRoutes
()
Object
For optimization. Call this to get the computed routes that can be passed to the constructor to avoid recomputing the routes.
Returns:
getInlineCssMojits
-
store -
env -
context
Returns details on how to make inline CSS for mojits.
This example comes from (a modified) GSG5. [ { mojitName: 'FlickrDetail', yuiModuleName: 'inlinecss/FlickrDetail', dest: '/blah/mojits/FlickrDetail/autoload/compiled' + '/css.iphone.client.js', srcs: { '/static/FlickrDetail/assets/index.css': true, '/static/FlickrDetail/assets/message.css': true } ]
Parameters:
-
storeStringresource store
-
envString"client" or "server"
-
contextObjectruntime context
Returns:
getRoute
-
method -
url -
routeMaker
Finds a route for a given method+URL
Parameters:
-
methodStringThe HTTP method.
-
urlStringThe URL to find a route for.
-
routeMakerRouteMakerThe route maker.
Returns:
MakeStore
-
cfg
Creates the Resource Store object.
Parameters:
-
cfgObjectConfiguration for the resource store.
Returns:
mergeRecursive
-
dest -
src -
typeMatch
Recursively merge properties of two objects
Parameters:
-
destObjectThe destination object.
-
srcObjectThe source object.
-
typeMatchBooleanOnly replace if src and dest types are the same type if true.
metaMerge
-
to -
from -
clobber
Used to merge meta objects into each other. Special consideration for certain headers values like 'content-type'.
Parameters:
-
toObjectThe target object.
-
fromObjectThe source object.
-
clobberBooleanTrue to overwrite existing properties.
