Aliasing for URL and CLI arguments
As is common now, most frameworks provide ways to make a URL shorter, more readable and more meaninful. This usually helps optimizing the ranking of the URL with search engines. In our case, using aliasing makes it possible to create even shorter calls both in Web mode and CLI mode.
If, for example, we have an addon named "home" and a function named "welcome" which we want to call with the parameter "name=David", we should normally call it with:
On the other hand, if we now insert the following alias definition in the aliases.ini configuration file:
[hello] addon=home action=welcome params=name/David template=hello_template
we can now make the same call just like this:
In CLI mode, using aliasing will save you quite some typing since the regular command:
/usr/bin/php index.php --addon home --action welcome --name David
would be shortened into:
/usr/bin/php index.php --hello
Obviously, in CLI mode the template is meaningless and is simply ignored.