Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
[playframework#165] Docs: Variables and Scripts in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hilton committed Feb 6, 2011
1 parent c8b8371 commit 50c3fd9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions documentation/manual/routes.textile
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ GET /pages/{id} Application.page

The first route is equivalent to the second one when the page ID is ‘home’. However, since it has higher priority, this route will be used as the default for the call to Application.page with ID ‘home’.

h3. Variables and scripts

You can also use the **${ … }** syntax for variables, and the **%{ … }** syntax for scripts in the **routes** file, as you can in templates. For example:

bc. %{ context = play.configuration.getProperty('context', '') }%

# Home page
GET ${context} Secure.login
GET ${context}/ Secure.login

Another example is the CRUD module’s **routes** file, which uses the **crud.types** tag to loop over model types to generate controller route definitions for each type.


h2. <a name="priority">Routes priority</a>

Expand Down

0 comments on commit 50c3fd9

Please sign in to comment.