开发者

Passing parameters to ->redirect() via $_GET

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


What you need is to properly build destination URL.

http://agiletoolkit.org/learn/understand/page/link

->univ()->redirect($this->api->getDestinationURL('newactivity',array('id'=>1)));

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

array('id'=>$_GET['id']);


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜