Create a gist now

Instantly share code, notes, and snippets.

Demo of some of some routes in Architect
<!-- A simple custom route -->
<route path="about-us">
<controller callback="aboutUsPage">Company</controller>
<!-- A bit more complex route -->
<route path="archives/((19|20)?[0-9]{2})/(\d{2})/(\d{2})">
<controller callback="showEntriesByDate">BlogArchives</controller>
<!-- A route with the new request type rules -->
<route path="request">
<request type="get" callback="get" />
<request type="post" callback="post" />
<request type="put" callback="put" />
<request type="delete" callback="delete" />
<request type="get" callback="getAjax" ajax="true" />
<request type="post" callback="postAjax" ajax="true" />
<request type="put" callback="putAjax" ajax="true" />
<request type="delete" callback="deleteAjax" ajax="true" />
<!-- Using wildcard (define wildcards in core-bootstraps.php, as: $arch->router->setWildcard('my_wildcard', '/regex/') ) -->
<route path="beam-me-up/:my_wildcard">
<controller callback="beamTargetToShip">TeleportationInterface</controller>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment