Using Aliases
By default, any of the public methods in the main class in your moduls can be accessed via this set URL structure:
http://Myapp.example.com/moduleName/MethodName?foo=bar
Or, if dot syntax is enabled (disabled by default),
http://Myapp.example.com/moduleName.MethodName?foo=bar
However, this can prove unsightly, and although these URLs are always available to be used (ie they cannot be turned off), for a variety of reasons you may wish to use your own URL structures. Aliases are a powerful and straightforward way to do that. Each alias is inherently linked to a module, and sits inside the <module> tag that it is linked to, as an <alias> tag. In this example, requesting the URL http://Myapp.example.com/user/list/all will result in the calling of MyModuleClass::listAllUsers(), if that method is implemented.
<module>
<name>mymodule</name>
<class>MyModuleClass</class>
<template>Mymodule</template>
<alias match="user/list/all">listAllUsers</alias>
<alias match="user/logout">authenticate?action=logOut</alias>
</module>
(Note that there’s no need to include an initial slash in the match tag of the alias. Quince automatically understands that the alias begins immediately after the path or hostname where your application sits, which is automatically given a trailing slash.)
Dynamic Aliases
In addition to replacing the normal way of specifying which module and method are being requested, you can also incorporate dynamic request variables into the actual URL structure, using variable placeholders. This way of using URLs is often called REST.
<alias match="news/category/$cat">getNewsByCategory?cat=$cat</alias>
You can also specify numeric-only placeholders in the match tag using a colon instead of the dollar-sign, but note that the dollar sign is still used in the destination of the alias:
<alias match="news/article/:id">readArticle?article=$id</alias>
Although you can add as many aliases as you like, beware of making them too similar. For instance, /$year/$month/$day and /$section/$category/$title are treated nearly identically, except for the names of the resulting extracted variables. In the case of ambiguity, Quince will stick with the first alias it finds that matches the current URL.
