[SR-Users] route() call with pv argument

Juha Heinanen jh at tutpro.com
Thu Mar 25 16:14:44 CET 2010


Daniel-Constantin Mierla writes:

 > it gets the content of parameter as static string, so if you would have
 > 
 > route[$var(test)] {
 > ...
 > }

the above does not make sense, because it would mean that the name of
the same route block would change on the fly.

what i try to achieve is that i make some kind of query on the request
(for example, using a db operation, dp_translate, etc), the result of
which then would determine which route block is executed:

$var(block) = some_function_on_the_request();
route("$var(block)");

if that is not possible, then i would need to use a switch statement on
$var(block), which is not a nice solution especially if i would need to
make it in several places of the script adding tens of extra lines to
to the script.

-- juha




More information about the sr-users mailing list