Page Blocks

Hosting sponsored by:

Point In Space

ToolKit Description

URL Request Handling

The PageBlocks framework allows for flexible URL handling including:

  • literal translation of URL to folders and page name with extensions
  • URL translation to folders with extensionless pages
  • embedding form data in "clean" URLs
  • complete URL abstraction where nothing in the URL has to match a real folder or path

Lasso's atBegin capabilities allow for trapping and routing incoming page requests. By testing the incoming request, PageBlocks can determine whether to treat the URL as a literal request, a partially abstracted request, or a completely abstracted request.

Literal URL requests are handled just like any typical Lasso installation. A request for /products/widgets.lasso is routed to load an actual file called widgets.lasso in the products folder.

Extensionless URLs are routed to the PageBlocks _pageConfig handler which is a flexible system for defining the config details for any page (template, title, authentcation requirements, etc).

Fully abstracted URLs are routed to the _pageMapper handler. The framework provides a $fw_requestURL object which breaks the URL into an array of elements at the / characters. Inside _pageMapper, the developer can analyse $fw_requestURL to determine which page should handle the request. So, a request for /sprockets/2006/cat107-WBk-R can be routed to source code files actually located at /catalog/itempage.dsp using the simple command fwpPage_mapURLToPage:'/catalog/itempage'. The code for that page can then parse the URL elements into meaningful components to use as necessary to deliver the correct content.

These capabilites are all internal to the framework code so that the application is easy to tranfser between Lasso servers. Minor virtual host configuration setup is necessary in order to have URLs with no file extension to be sent to Lasso, and virtually any hosting provider should be willing to make them.


© 2002-2012, pageblocks.org