lucee.Component coldbox.system.FrameworkSupertype coldbox.system.web.routing.Router
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- Manages all the routing definitions for the application and exposes the ColdBox Routing DSL
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
string
|
baseURL
Base routing URL.
|
true
|
false
|
|
any
|
controller
ColdBox Controller.
|
true
|
false
|
|
boolean
|
enabled
Flag to enable/disable routing.
|
true
|
true
|
false
|
boolean
|
extensionDetection
Detect extensions flag, so it can place a 'format' variable on the rc.
|
true
|
true
|
false
|
boolean
|
fullRewrites
This flag denotes if full URL rewrites are enabled or not.
|
false
|
true
|
false
|
boolean
|
looseMatching
Loose matching flag for regex matches.
|
false
|
true
|
false
|
struct
|
moduleRoutingTable
Modules Routing Table.
|
true
|
false
|
|
struct
|
namespaceRoutingTable
Namespace routing tables.
|
true
|
false
|
|
array
|
routes
The routing table.
|
true
|
false
|
|
string
|
thisModule
Fluent route construct for modules.
|
true
|
false
|
|
struct
|
thisRoute
Fluent route construct.
|
true
|
false
|
|
boolean
|
throwOnInvalidExtension
Throw an exception when extension detection is invalid or not.
|
false
|
true
|
false
|
boolean
|
uniqueURLS
Flag to enable unique or not URLs.
|
false
|
true
|
false
|
string
|
validExtensions
Initialize the valid extensions to detect.
|
json,jsont,xml,cfm,cfml,html,htm,rss,pdf
|
true
|
false
|
struct
|
withClosure
Fluent route construct for with routing.
|
true
|
false
|
Constructor Summary | |
---|---|
init(any controller)
Constructor. |
Method Summary | |
---|---|
any
|
addModuleRoutes(any pattern, any module, [boolean append='true'])
Register modules routes in the specified position in the main routing table, and returns itself. |
any
|
addNamespace(any pattern, any namespace, [boolean append='true'])
Register a namespace in the specified position in the main routing table, and returns itself. |
any
|
addRoute(string pattern, [string handler=''], [any action=''], [boolean packageResolverExempt='false'], [string matchVariables=''], [string view=''], [boolean viewNoLayout='false'], [boolean valuePairTranslation='true'], [any constraints='[runtime expression]'], [string module=''], [string moduleRouting=''], [string namespace=''], [string namespaceRouting=''], [boolean ssl='false'], [boolean append='true'], [any response=''], [numeric statusCode='200'], [string statusText=''], [any condition=''], [string name=''], [string domain=''], [string redirect=''], [string event=''], [string verbs=''], [string layout=''], [struct headers='[runtime expression]'], [struct rc='[runtime expression]'], [struct prc='[runtime expression]'], [string viewModule=''], [string layoutModule=''])
Adds a route to dispatch and returns itself. |
any
|
append()
Appends the route to the routing table. |
any
|
as(any name)
Registers the route as a named route. |
any
|
configure()
This method is to be implemented by the application router you create. |
any
|
constraints(any map)
Register a struct of constraints for the route. |
any
|
delete(any pattern, [any target])
Register a route with DELETE restriction. |
any
|
end()
This is a global route definition terminator. |
any
|
endWith()
End a with closure and returns itself. |
private struct
|
filterRouteActions(struct initial, [array only='[runtime expression]'], [array except='[runtime expression]'])
Get the correct route actions based on only and except lists. |
any
|
get(any pattern, [any target])
Register a route with GET restriction. |
any
|
getAutoReload()
|
any
|
getBaseURL()
|
string
|
getEnabled()
|
string
|
getExtensionDetection()
|
any
|
getFullRewrites()
|
string
|
getLooseMatching()
|
struct
|
getMemento()
A quick snapshot of the router state. |
array
|
getModuleRoutes(any module)
Get a module's routes array. |
string
|
getModuleRoutingTable()
|
struct
|
getModulesRoutingTable()
A quick ColdBox4 compatibility wrapper. |
array
|
getNamespaceRoutes(any namespace)
Get a namespace routes array. |
string
|
getNamespaceRoutingTable()
|
string
|
getRoutes()
|
string
|
getThisModule()
|
string
|
getThisRoute()
|
string
|
getThrowOnInvalidExtension()
|
any
|
getUniqueURLS()
|
string
|
getValidExtensions()
|
string
|
getWithClosure()
|
any
|
group([struct options='[runtime expression]'], [any body])
This is the new approach to the with closure approach which has been marked as deprecated.
|
any
|
header(any name, any value, [boolean overwrite='true'])
Add a header to a route. |
any
|
headers(any map, [boolean overwrite='true'])
Appends a collection of header name-values to a pattern. |
any
|
includeRoutes(any location)
Includes a routes configuration file as an added import and returns itself after import. |
private struct
|
initRouteDefinition()
Construct a route definition construct. |
boolean
|
isValidExtension(any extension)
Verifies if an extension is valid in the Router. |
any
|
options(any pattern, [any target])
Register a route with OPTIONS restriction. |
any
|
packageResolver(boolean toggle)
Turn package resolver on/off. |
any
|
patch(any pattern, [any target])
Register a route with PATHC restriction. |
any
|
post(any pattern, [any target])
Register a route with POST restriction. |
any
|
prc(any name, any value, [boolean overwrite='true'])
Register a private request collection name-value pair if the route matches. |
any
|
prcAppend(any map, [boolean overwrite='true'])
Appends a collection of name-values to the PRC if the route matches. |
any
|
prepend()
Prepends the route to the routing table. |
private any
|
processRouteOptionals(struct thisRoute)
Process route optionals. |
any
|
processWith(any args)
process a with closure. |
any
|
put(any pattern, [any target])
Register a route with PUT restriction. |
any
|
rc(any name, any value, [boolean overwrite='true'])
Register a request collection name-value pair if the route matches. |
any
|
rcAppend(any map, [boolean overwrite='true'])
Appends a collection of name-values to the RC if the route matches. |
any
|
removeModuleRoutes(any module)
Remove a module's routing table and registration points and return itself. |
any
|
removeNamespaceRoutes(any namespace)
Remove a namespace's routing table and registration points and return itself. |
any
|
resources(any resource, [any handler='[runtime expression]'], [any parameterName='id'], [any only='[runtime expression]'], [any except='[runtime expression]'], [string module=''], [string namespace=''])
Create all RESTful routes for a resource. |
any
|
route(any pattern, [any target], [any name=''])
Initiate a new route registration. |
any
|
setAutoReload()
|
any
|
setBaseURL([string baseURL])
|
any
|
setEnabled(boolean enabled)
|
any
|
setExtensionDetection(boolean extensionDetection)
|
any
|
setFullRewrites([boolean target])
|
any
|
setLooseMatching(boolean looseMatching)
|
any
|
setModuleRoutingTable(struct moduleRoutingTable)
|
any
|
setNamespaceRoutingTable(struct namespaceRoutingTable)
|
any
|
setRoutes(array routes)
|
any
|
setThisModule(string thisModule)
|
any
|
setThisRoute(struct thisRoute)
|
any
|
setThrowOnInvalidExtension(boolean throwOnInvalidExtension)
|
any
|
setUniqueURLS([boolean uniqueURLS])
|
any
|
setValidExtensions(any extensions)
|
any
|
setWithClosure(struct withClosure)
|
any
|
startup()
This method is called by the Routing Services to make sure the router is ready for operation. |
any
|
to(any event)
Terminates the route to execute an event. |
any
|
toHandler(any handler)
Terminates the route to execute a specific handler. |
any
|
toModuleRouting(any module)
Terminate the route to be the entry point for module routing. |
any
|
toNamespaceRouting(any namespace)
Terminate the route to be the entry point for namespace routing. |
any
|
toRedirect(any target, [any statusCode='301'])
Redirects to a route or full HTTP URL if the pattern matched. |
any
|
toResponse(any body, [numeric statusCode='200'], [any statusText='Ok'])
Terminates the route to execute a response closure with optional status codes and texts. |
any
|
toView(any view, [any layout=''], [boolean noLayout='false'], [any viewModule=''], [any layoutModule=''])
Send a route to a view/layout combo. |
any
|
valuePairTranslator(boolean toggle)
Turns on/off the value pair translator from extra metdata in a URL. |
any
|
with([string pattern], [string handler], [any action], [boolean packageResolverExempt], [string matchVariables], [string view], [boolean viewNoLayout], [boolean valuePairTranslation], [any constraints], [string module], [string moduleRouting], [string namespace], [string namespaceRouting], [boolean ssl], [boolean append], [string domain])
Starts a with closure, where all arguments will be prefixed for the next concatenated addRoute() methods until an endWith() is called. |
any
|
withAction(any action)
Registers a pattern into a specific action for execution. |
any
|
withCondition(any condition)
Registers a closure/lambda that will be called once the route matches to verify if we can proceed and execute its terminators. |
any
|
withDomain(any domain)
Registers a pattern that must exist under a domain pattern. |
any
|
withHandler(any handler)
Registers a pattern into a specific handler for execution. |
any
|
withModule(any name)
Registers a pattern into a specific module routing table. |
any
|
withNamespace(any name)
Registers a pattern into a specific Namespace routing table. |
any
|
withSSL()
Forces SSL on the route. |
any
|
withVerbs(any verbs)
Restricts the route to specific HTTP Verbs. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
controller
- The ColdBox controller linkageProperty Detail |
---|
Base routing URL
access
- publicrequired
- falsereturntype
- anyserializable
- trueColdBox Controller
access
- publicrequired
- falsereturntype
- anyserializable
- trueFlag to enable/disable routing
access
- publicrequired
- falsereturntype
- anyserializable
- trueDetect extensions flag, so it can place a 'format' variable on the rc
access
- publicrequired
- falsereturntype
- anyserializable
- trueThis flag denotes if full URL rewrites are enabled or not. Meaning if the `index.cfm` is in the path of the rewriter or not. The default value is **false**.
access
- publicrequired
- falsereturntype
- anyserializable
- trueLoose matching flag for regex matches
access
- publicrequired
- falsereturntype
- anyserializable
- trueModules Routing Table
access
- publicrequired
- falsereturntype
- anyserializable
- trueNamespace routing tables
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe routing table
access
- publicrequired
- falsereturntype
- anyserializable
- trueFluent route construct for modules
access
- publicrequired
- falsereturntype
- anyserializable
- trueFluent route construct
access
- publicrequired
- falsereturntype
- anyserializable
- trueThrow an exception when extension detection is invalid or not
access
- publicrequired
- falsereturntype
- anyserializable
- trueFlag to enable unique or not URLs
access
- publicrequired
- falsereturntype
- anyserializable
- trueInitialize the valid extensions to detect
access
- publicrequired
- falsereturntype
- anyserializable
- trueFluent route construct for with routing
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Register modules routes in the specified position in the main routing table, and returns itself
pattern
- The pattern to match against the URLmodule
- The module to load routes forappend
- Whether the module entry point route should be appended or pre-pended to the main routes array. By default we append to the end of the arrayRegister a namespace in the specified position in the main routing table, and returns itself
pattern
- The pattern to match against the URL.namespace
- The name of the namespace to registerappend
- Whether the route should be appended or pre-pended to the array. By default we append to the end of the arrayAdds a route to dispatch and returns itself.
pattern
- The pattern to match against the URL.handler
- The handler to execute if pattern matched.action
- The action in a handler to execute if a pattern is matched. This can also be a structure based on the HTTP method(GET,POST,PUT,DELETE). ex: {GET:'show', PUT:'update', DELETE:'delete', POST:'save'}packageResolverExempt
- If this is set to true, then the interceptor will not try to do handler package resolving. Else a package will always be resolved. Only works if :handler is in a patternmatchVariables
- DEPRECATED: Use RC or PRC structs instead. A string of name-value pair variables to add to the request collection when this pattern matches. This is a comma delimmitted list. Ex: spaceFound=true,missingAction=onTestview
- The view to dispatch if pattern matches. No event will be fired, so handler,action will be ignored.viewNoLayout
- If view is choosen, then you can choose to override and not display a layout with the view. Else the view renders in the assigned layout.valuePairTranslation
- Activate convention name value pair translations or not. Turned on by defaultconstraints
- A structure of regex constraint overrides for variable placeholders. The key is the name of the variable, the value is the regex to try to match.module
- The module to add this route tomoduleRouting
- Called internally by addModuleRoutes to add a module routing route.namespace
- The namespace to add this route tonamespaceRouting
- Called internally by addNamespaceRoutes to add a namespaced routing route.ssl
- Makes the route an SSL only route if true, else it can be anything. If an ssl only route is hit without ssl, the interceptor will redirect to it via sslappend
- Whether the route should be appended or pre-pended to the array. By default we append to the end of the arrayresponse
- An HTML response string to send back or a closure to be executed that should return the response. The closure takes in a 'params' struct of all matched params and the string will be parsed with the named value pairs as ${param}statusCode
- The HTTP status code to send to the browser response.statusText
- Explains the HTTP status code sent to the browser response.condition
- A closure or UDF to execute that MUST return true to use route if matched or false and continue.name
- The name of the routedomain
- The domain to match, including wildcardsredirect
- If used, then the route will dispatch a relocation to this value as the new route using the `statuCode` default of 301 (Permanent) or if you define a `statusCode` we will use that.event
- The event to execute if route matchesverbs
- The allowed HTTP Verbs for the routelayout
- The view layout to useheaders
- The HTTP headers to attach to the response if route matchesrc
- The RC name value pairs to attach if the reponse matchesprc
- The PRC name value pairs to attach if the reponse matchesviewModule
- The module the view belongs tolayoutModule
- The module the layout belongs toAppends the route to the routing table. By default all routes are appended.
route( "hello", "main.index" ).append();
Registers the route as a named route
route( "hello", "main.index" ).as( "main" )
name
- The name to use for the routeThis method is to be implemented by the application router you create. This is where you will define all your routing.
Register a struct of constraints for the route
route( "hello", "main.index" ).constraints( { ... } )
map
- A structure of regex constraint overrides for variable placeholders. The key is the name of the variable, the value is the regex to try to match.Register a route with DELETE restriction. Same as calling the following
route( "/hello", "hello" ).withVerbs( "DELETE" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executeThis is a global route definition terminator. It will grab whatever the fluent API collected and create a route from it.
route( "hello" ).withHandler( "luis" ).withAction( "hello" ).end();
End a with closure and returns itself
group()
function.Get the correct route actions based on only and except lists
initial
- The initial set of route actionsonly
- Limit actions with onlyexcept
- Exclude actions with exceptRegister a route with GET restriction. Same as calling the following
route( "/hello", "hello" ).withVerbs( "GET" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executeA quick snapshot of the router state
Get a module's routes array
module
- The module to getA quick ColdBox4 compatibility wrapper
Get a namespace routes array
namespace
- The namespace to getThis is the new approach to the with
closure approach which has been marked as deprecated.
You can pass any route option via the options
structure and those values will be prefixed against
any routing values done withing the body
closure.
group( { pattern="/api", target="api", handler="api" }, function( options ){ route( "/", "main.index" ); route( "/echo", "echo" ); route( "/users/:id" ).withAction( { get : "index", post : "save" } ).toHandler( "users" ); } )
options
- The route options that match routing, look at the addRoute()
methodbody
- The closure or lambda to contain all the routing methods to be grouped with the options data.Add a header to a route
route( "hello", "main.index" ).header( "name", "hello" )
name
- The header namevalue
- The header valueoverwrite
- Overwrite if already definedAppends a collection of header name-values to a pattern
route( "hello", "main.index" ).headers( { ... } )
map
- The structure of headers to issueoverwrite
- Overwrite the elementsIncludes a routes configuration file as an added import and returns itself after import
location
- The include location of the routes configuration template. Do not add '.cfm'Construct a route definition construct
Verifies if an extension is valid in the Router
extension
- The extension to validateRegister a route with OPTIONS restriction. Same as calling the following
route( "/hello", "hello" ).withVerbs( "OPTIONS" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executeTurn package resolver on/off
route( "hello", "main.index" ).packageResolver( false );
toggle
- The boolean toggleRegister a route with PATHC restriction. Same as calling the following
route( "/hello", "hello" ).withVerbs( "PATHC" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executeRegister a route with POST restriction. Same as calling the following
route( "/hello", "hello" ).withVerbs( "POST" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executeRegister a private request collection name-value pair if the route matches
route( "hello", "main.index" ).prc( "private", true )
name
- The key namevalue
- The valueoverwrite
- Overwrite the valueAppends a collection of name-values to the PRC if the route matches
route( "hello", "main.index" ).prcAppend( { ... } )
map
- The structure to appendoverwrite
- Overwrite elements, default behaviorPrepends the route to the routing table. By default all routes are appended.
route( "hello", "main.index" ).prepend();
Process route optionals
thisRoute
- The route structureprocess a with closure
args
- The arugments to processRegister a route with PUT restriction. Same as calling the following
route( "/hello", "hello" ).withVerbs( "PUT" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executeRegister a request collection name-value pair if the route matches
route( "hello", "main.index" ).rc( "private", true )
name
- The key namevalue
- The valueoverwrite
- Overwrite the valueAppends a collection of name-values to the RC if the route matches
route( "hello", "main.index" ).rcAppend( { ... } )
map
- The structure to appendoverwrite
- Overwrite elements, default behaviorRemove a module's routing table and registration points and return itself
module
- The module to removeRemove a namespace's routing table and registration points and return itself
namespace
- The namespace to removeCreate all RESTful routes for a resource. It will provide automagic mappings between HTTP verbs and URLs to event handlers and actions. By convention, the name of the resource maps to the name of the event handler. Example: `resource = photos` Then we will create the following routes: - `/photos` : `GET` -> `photos.index` Display a list of photos - `/photos/new` : `GET` -> `photos.new` Returns an HTML form for creating a new photo - `/photos` : `POST` -> `photos.create` Create a new photo - `/photos/:id` : `GET` -> `photos.show` Display a specific photo - `/photos/:id/edit` : `GET` -> `photos.edit` Return an HTML form for editing a photo - `/photos/:id` : `POST/PUT/PATCH` -> `photos.update` Update a specific photo - `/photos/:id` : `DELETE` -> `photos.delete` Delete a specific photo
resource
- The name of a single resource or a list of resources or an array of resourceshandler
- The handler for the route. Defaults to the resource name.parameterName
- The name of the id/parameter for the resource. Defaults to `id`.only
- Limit routes created with only this list or array of actions, e.g. "index,show"except
- Exclude routes with an except list or array of actions, e.g. "show"module
- If passed, the module these resources will be attached to.namespace
- If passed, the namespace these resources will be attached to.Initiate a new route registration. Please note that you must finalize the registration by calling a terminator fluently. Unless, you pass in a target which can be a reponse closure/lambda or an event string.
// with terminator route( "/home" ).to( "main.index" ) // with inline lambda route( "/home", function( event, rc, prc ){ return "hello"; } ) // with inline event route( "/home", "main.index" ) // with inline event + name route( "/home", "main.index", "home" )
pattern
- The pattern to registertarget
- A response closure/lambda or an event string to executename
- The name of the routebaseURL
enabled
extensionDetection
target
looseMatching
moduleRoutingTable
namespaceRoutingTable
routes
thisModule
thisRoute
throwOnInvalidExtension
uniqueURLS
extensions
withClosure
This method is called by the Routing Services to make sure the router is ready for operation. This is ONLY called by the routing services.
Terminates the route to execute an event
route( "old" ).to( "main.index" ); route( "old" ).to( "main" ); route( "old" ).to( "api:main.index" );
event
Terminates the route to execute a specific handler. Usually this will be done if the action is coming via the URL as a `:action` placeholder or you want the default `index` action to execute.
route( "about/:action" ).toHandler( "static" ) route( "users/:action?" ).toHandler( "users" )
handler
Terminate the route to be the entry point for module routing
route( "/api/v1" ).toModuleRouting( "API" );
module
Terminate the route to be the entry point for namespace routing
route( "/api/v1" ).toNamespaceRouting( "API" );
namespace
Redirects to a route or full HTTP URL if the pattern matched
route( "old" ).toRedirect( "/api/new" ); route( "old" ).toRedirect( "/api/new", 302 ); route( "old" ).toRedirect( "https://www.ortussolutions.com");
target
statusCode
Terminates the route to execute a response closure with optional status codes and texts
route( "old" ).toResponse( ( event, rc, prc ) => { ... return "html/data" } );
body
statusCode
statusText
Send a route to a view/layout combo
route( "hello", "main.index" ).toView( "hello" ); route( "hello", "main.index" ).toView( view="hello", layout="rest" ); route( "hello", "main.index" ).toView( view="hello", noLayout=true );
view
layout
noLayout
viewModule
layoutModule
Turns on/off the value pair translator from extra metdata in a URL
route( "hello", "main.index" ).valuePairTranslator( false );
toggle
- The boolean toggleStarts a with closure, where all arguments will be prefixed for the next concatenated addRoute() methods until an endWith() is called
group()
function.pattern
- The pattern to match against the URL.handler
- The handler to execute if pattern matched.action
- The action in a handler to execute if a pattern is matched. This can also be a structure based on the HTTP method(GET,POST,PUT,DELETE). ex: {GET:'show', PUT:'update', DELETE:'delete', POST:'save'}packageResolverExempt
- If this is set to true, then the interceptor will not try to do handler package resolving. Else a package will always be resolved. Only works if :handler is in a patternmatchVariables
- A string of name-value pair variables to add to the request collection when this pattern matches. This is a comma delimmitted list. Ex: spaceFound=true,missingAction=onTestview
- The view to dispatch if pattern matches. No event will be fired, so handler,action will be ignored.viewNoLayout
- If view is choosen, then you can choose to override and not display a layout with the view. Else the view renders in the assigned layout.valuePairTranslation
- Activate convention name value pair translations or not. Turned on by defaultconstraints
- A structure of regex constraint overrides for variable placeholders. The key is the name of the variable, the value is the regex to try to match.module
- The module to add this route tomoduleRouting
- Called internally by addModuleRoutes to add a module routing route.namespace
- The namespace to add this route tonamespaceRouting
- Called internally by addNamespaceRoutes to add a namespaced routing route.ssl
- Makes the route an SSL only route if true, else it can be anything. If an ssl only route is hit without ssl, the interceptor will redirect to it via sslappend
- Whether the route should be appended or pre-pended to the array. By default we append to the end of the arraydomain
- The domain to match, including wildcardsRegisters a pattern into a specific action for execution. The action string can be a single action or a struct of
HTTP Verb to actions map. Usually this is called to keep track of actions throughout a route definition and then follow
it with a handler terminator or the global terminator: `end()`
Please see examples below:
route( "api/user" ).\withAction( { get : "index", delete : "delete" } ).toHandler( "User" ); route( "api/user/details" ).withAction( "details" ).toHandler( "User" ); route( "api/:handler" ).withAction( "index" ).end();
action
Registers a closure/lambda that will be called once the route matches to verify if we can proceed and execute its terminators. The closure/lambda must return boolean
route( "hello", "main.index" ).withCondition( () => return false )
condition
- closure or lambdaRegisters a pattern that must exist under a domain pattern
route( "hello", "main.index" ).withDomain( ":username.forgebox.dev" )
domain
- The domain constructRegisters a pattern into a specific handler for execution. The handler string can include dot notations for folder paths or even
a module `:` designator. Usually this is called if you want to delegate a route to a specific action terminator `toAction()`.
This action can be a single action or a struct of HTTP Verbs to action maps. Please note that this is NOT the same as using
the `toHandler()` terminator, which terminates the route addition to a specific handler.
Please see examples below:
route( "api/user" ).withHandler( "User" ).toAction( { get : "index", delete : "delete" } ); route( "api/user/details" ).withHandler( "User" ).toAction( "details" );
handler
- The handler syntaxRegisters a pattern into a specific module routing table
route( "hello", "main.index" ).withModule( "explorer" )
name
- The module nameRegisters a pattern into a specific Namespace routing table
route( "hello", "main.index" ).withNamespace( "myAPI" )
name
- The namespace nameForces SSL on the route
route( "hello", "main.index" ).withSSL()
Restricts the route to specific HTTP Verbs. Just pass a list of allowed verbs
route( "hello", "main.index" ).withVerbs( "GET,POST,PUT" );
verbs
- The list of HTTP Verbs