通过 $_GET 将参数传递给 ->redirect()
您好,我有这句话
$g->addButton('')->set('NEW ACTIVITY')->js('click')->univ()->redirect('newactivity');
Is it possible to call the "redirect" method and pass参数 via $_GET ?那么在“newactivity”页面中我可以要求 $_GET['something'] 吗?
像这样的东西
$g->addButton('')->set('NEW ACTIVITY')->js('click')->univ()->redirect('newactivity?id=1'); (this doesn't work)
or
$g->addButton('')->set('NEW ACTIVITY')->js('click')->univ()->redirect('newactivity','id=1');
谢谢
Hi I have this sentence
$g->addButton('')->set('NEW ACTIVITY')->js('click')->univ()->redirect('newactivity');
Is it possible to call the "redirect" method and passing parameters via $_GET ? so in the page "newactivity" I can ask for $_GET['something'] ?
Something like this
$g->addButton('')->set('NEW ACTIVITY')->js('click')->univ()->redirect('newactivity?id=1'); (this doesn't work)
or
$g->addButton('')->set('NEW ACTIVITY')->js('click')->univ()->redirect('newactivity','id=1');
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要的是正确构建目标 URL。
http://agiletoolkit.org/learn/understand/page/link
使用stickyGET会影响您将在此时生成的所有网址。因此,如果添加 2 个链接,每个链接都会传递 ID。
如果您需要传递已经通过 GET 传递的参数,那么 StickyGET 会更好,例如
What you need is to properly build destination URL.
http://agiletoolkit.org/learn/understand/page/link
using stickyGET will affect ALL the urls you are going to produce form this point on. So if you add 2 links, each of them would be passing ID.
stickyGET is better if you need to pass argument which was already passed through GET, such as
这里也是其他 ATK4 开发者聊天的地方,也许是您 ATK4 Q 的另一个资源。 https://chat.stackoverflow.com/rooms/2966/agile-toolkit-atk4
Here is a place where other ATK4 Developers chat too, perhaps another resource for your ATK4 Q's. https://chat.stackoverflow.com/rooms/2966/agile-toolkit-atk4