Re: [Erlangweb-users] using dispatcher.conf routes in dynamic content
Brought to you by:
etcerlangweb,
paulgray
|
From: Michal P. <mic...@er...> - 2009-05-13 07:48:47
|
Hello,
There is no such thing as reverse dispatching: the main reason
for that is there might be many routes that lead to the one controller,
for example:
{dynamic, "^/index\.html$", {home, main}}.
{dynamic, "^/$", {home, main}}.
{dynamic, "^/home$", {home, main}}.
However, you can still access the URL user entered getting it
from the process dictionary:
wpart:fget("__path")
(note that there is a double underscore character).
----- "Zoltan Lajos Kis" <ki...@tm...> wrote:
> Hi all,
>
> I might be missing a point, but how do I refer to the dynamic routes
> in
> dispatcher.conf from within my content?
>
> Taking this example route from the wiki is there a function that does
>
> something like the following function?
>
> {dynamic, "^/blog/post/(?<post_no>[0-9]+)$", {blog, display_post}}.
>
> route:create({blog, display_post}, [{post_no, "23"}]) ->
> "/blog/post/23"
>
>
> Kindest regards,
> Zoltan.
Best regards,
--
Michal Ptaszek
www.erlang-consulting.com
|