• Home
  • Why Erstwhile?
  • Getting Started
  • Learn Erstwhile
  • API Docs
  • Home
  • Why Erstwhile?
  • Getting Started
  • Learn Erstwhile
  • API Docs
  • API Documentation
  • ErstwhileApp
    • getDebug()
    • getConfig(property)
    • setLayout(layout)
    • getComponent(id)
    • getModel(model)
    • redirect(path, updateHistory: true, scrollTop: true)
    • defer(func, delay: 0, selector: null)
    • openModal(controller, modal, args)
    • setModalAttributes(args)
    • closeModal()
  • ErstwhileComponent
    • getCSS()
    • isHidden()
    • hide()
    • show()
    • setProperty(property, value)
    • getProperty(property)
    • isContainer()
    • initialize()
    • unload()
    • getHTML(innerDom)
    • receiveUpdate(key, value)
    • receiveGlobalUpdate(key, value)
    • getTag()
    • getClassName()
    • prepareAttributes()
  • ErstwhileForm
    • getControl(name)
    • showErrors(response)
    • clearErrors()
    • registerComponent(id)
    • deregisterComponent(id)
    • getValues()
  • ErstwhileControl
    • getKey()
    • getValue()
    • setValue(value)
    • setValid(validFlag, message)
  • ErstwhileLayout
  • ErstwhileTheme
    • getRequires()
    • getCSS(appRootDir, workingDir, themeConfig)
    • getFontFolder(appRootDir)
    • getCSSFolder(appRootDir)
    • getJSFolder(appRootDir)
    • getCSSLinks(rootDir)
    • getScripts(rootDir)
  • ErstwhileController
    • preAction(next)
    • postAction(next)
    • getControllerPath()
    • getRoutes()
  • ErstwhileModel
    • makeRequest(path, params, method: "get", data, headers)

getRoutes()

14 views 0

Written by mike
August 7, 2023
Return

Either false to use the default routing behavior, or an object of paths and the actions you would like to map them too.

  {
    "/login": {
      "action": "login"
    },
    "/logout": {
      "action": "logout"
    }
  }
Effect

Overriding this method lets one change the default routing behavior of your controllers, if needed. You can specify any path in the key, and denote wildcards with :id syntax. Each of these whildcards will be passed in the the args array of your action if the path is matched.

Was this helpful?

Yes  No
Related Articles
  • getControllerPath()
  • postAction(next)
  • preAction(next)
  • makeRequest(path, params, method: “get”, data, headers)
  • ErstwhileModel
  • ErstwhileController

Didn't find your answer? Contact Us

Previously
getControllerPath()
Up Next
ErstwhileModel

loader

Join our Mailing List     

  • Privacy Policy
  • Terms of Use
  • © 2025 RestlessDev. Made in New Orleans.

Welcome to Erstwhile

Thank you for checking out Erstwhile. We’re just getting started, so if you’d like to keep up with our progress please register now and we’ll let you know when new releases come out.

loader

Email Address*

Name