On Fri, 09 May 2014 08:08:27 GMT, Darius Clark wrote:

On Fri, 09 May 2014 07:58:53 GMT, Sönke Ludwig wrote:

On Fri, 09 May 2014 07:42:17 GMT, Darius Clark wrote:

Hello,

Thank you for your reply. I am looking through the example, and would like to know if theres a way to accept something like /example/:id ? Do I use "HTTPServerResponse res" to fetch the params from the url along with any other parameters?

This can be done using an explicit path and "generic" parameters prefixed with an underscore. I'll add a proper example to the documentation.

@path("/example/:id")
void getExample(int _id)
{
    // ...
}

Thank you :) Just to clarify could I do

@path("/example/:id")
void getExample(int _id){

}

@path("/example/:id/:next")
void getExample(int _id, string _next){

}

so I could define a path without it depending/relying on the name of the diet file? Since my diet files are like home.index.dt, home.blog.dt, etc (as you suggested in a previous topic), I dont want it to contain links like that.

Thank you again for your replies. This will make my code easier to review and cleaner.

Definitely. The Diet templates are rendered with the explicit file name and the special vibe.web.web.render!() template, which doesn't need an explicit HTTPServerResponse parameter, so they are completely independent:

@path("/example/:id/:next")
void getExample(int _id, string _next)
{
    render!("home.something.example.dt", ...);
}