You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Becker <jo...@gmx.net> on 2005/07/19 17:28:40 UTC

how to call a flow-function from a (request)-string

Hi,

In one point of my sitemap, all requests come in and are send to a 
flow-function.
...
<map:match pattern="*">
     <map:call function="start">
           <map:parameter name="param" value="{1}"/>
     </map:call>               
</map:match>
...


The function:
function start() {
    var param = cocoon.parameters["param"];
    // now I want to call the function, that is "requested" by the 
parameter.
    // For example:
    // If param was "hello" , I want the function hello() executed and 
so on.
}

How can I call a function from a (request)-string?


Thanks
Jonny








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: how to call a flow-function from a (request)-string

Posted by Johannes Becker <jo...@gmx.net>.
Thanks for the quick answer.

 > Why not just declare the functions as you need them ?
I'm just playing around, checking out things.

Cheers
Jonny

Jorg Heymans wrote:

>Johannes Becker wrote:
>
>  
>
>>The function:
>>function start() {
>>   var param = cocoon.parameters["param"];
>>    
>>
>
>     eval(param) should work IIRC.
>
>Note that by doing this you are losing much of the declarative nature of
>the sitemap. Why not just declare the functions as you need them ?
>
>
>Regards,
>Jorg
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: how to call a flow-function from a (request)-string

Posted by Jorg Heymans <jh...@domek.be>.
Johannes Becker wrote:

> The function:
> function start() {
>    var param = cocoon.parameters["param"];

     eval(param) should work IIRC.

Note that by doing this you are losing much of the declarative nature of
the sitemap. Why not just declare the functions as you need them ?


Regards,
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org