开发者

Zend Framework Controller with action as steps

开发者 https://www.devze.com 2023-03-29 12:41 出处:网络
I am working on a register controller to create a account. I send the user to a special url: www.name.com/activate/1/fdafdsafdasfdsa where 1 is a id en fdafdsafsda is a hash. I check these in the publ

I am working on a register controller to create a account. I send the user to a special url: www.name.com/activate/1/fdafdsafdasfdsa where 1 is a id en fdafdsafsda is a hash. I check these in the public function init. If the id and hash are right the init does a forward to step1: $this->_forward('step1', null, null, array());

Step 1 is a form and if this is posted and correct step 1 does a forward to step2. But now the problem is in step 2 there is also a form. But I don't want to change t开发者_C百科he url so I use forward. But when posting on step2 he send the user back to step1. What is a good solution to fix this problem?

Thanx


You can use an extra parameter in your form to indicate which step is the current. Then, in your "Controller > predispatch", you can "select" the right method.

But for my personnal use, I prefere to change the URL to point the differents steps (and I implement a check to ensure the user follow the sequence of step).

0

精彩评论

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