When I add this rout to my server
server::server(cppcms::service &srv) : cppcms::aplication(srv)
{
dispacher().assign("/(\\d+)/get/(\\w+)", &server::get, this, 1, 2);
}
mapper().assign()
to be able to use routs as server/1/get/hello
or server/2/get/hello
? <% url "1/get" using [a variable] %>
does work?
First of all take a look on: http://cppcms.com/wikipp/en/page/cppcms_1x_tut_url_mapping
What you are missing is mapper:
mapper().assign("get","/{1}/get/{2}");
And than
<% url "get" using [a variable for number], [a variable for text] %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.