nette/application 3.2: aliases for links

David Grudl
Nette Core | 8143
+
+4
-

I've added the option to define aliases for link targets in Nette Application 3.2. (Currently in the 3.2.x-dev branch).

In applications written in Nette, we naturally refer to Presenter:actions. But sometimes it can be advantageous to give such a pair an alias. For example, name the home page Front:Home:default simply as home, Admin:Dashboard:default as admin, and so on.

Aliases are simply defined in the configuration file:

application:
	aliases:
		home: Front:Home:default
		admin: Admin:Dashboard:default
		login: Auth:Sign:in

And they are referenced using the at-sign (@):

<a n:href="@home">Home page</a>

or

$this->redirect('@login');

I would be glad if you could test this and write any comments and suggestions.