是否可以向 gather 标签中的 action 属性添加其他变量? [英] Is it possible to add additional variables to the action attribute in the gather tag?

查看:33
本文介绍了是否可以向 gather 标签中的 action 属性添加其他变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多步调用函数,但我希望两个调用都通过同一个脚本运行.我不确定是否可以通过嵌套收集标记来实现.首先可以像这样嵌套gather标签吗?

I have a multi-step Call in function but I want both calls to run through the same script. I'm not sure if it can be achieved by nesting gather tags. First is it possible to nest the gather tags like this?

<gather action="page.php?step=1">
    <say>Enter ID #</say>
    <gather action="page.php?step=2">
        <say>Pres 1 to do blah blah</say>
    </gather>
</gather>

第二是我可以在 <Gather> 标签中的 action 属性中添加一个变量.它似乎对我不起作用.

Second is can I add a variable to the action attribute in the <Gather> tag. It doesn't seem to be working for me.

推荐答案

Twilio Evangelist 在这里.

Twilio Evangelist here.

如果你改变了你的Gather GET 的 action 方法,对你来说可能更容易:

If you change the method of your Gather action method to GET, it might be easier for you:

<Gather action="page.php?step=2" method="GET">
    <Say>Pres 1 to do blah blah</Say>
</Gather>

此外,在上面的示例中,您在 中有一个 ,这是不受支持的.

Also, in the example above you have a <Gather> inside of a <Gather>, which isn't supported.

我不确定 PHP 如何进行路由,但我倾向于使用 URL 而不是查询:

I'm not sure how PHP does routing, but I've tended towards using the URL rather than a query:

<Gather action="/next_step/1"> ... </Gather>

<Gather action="/next_step/456"> ... </Gather>

希望这会有所帮助!

这篇关于是否可以向 gather 标签中的 action 属性添加其他变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆