|
|||
|
If I have a login form embeded in index.phtml and that form calls loginAction (which has no associated view as I simply want it to give me a yes/no for authorization) how would I get loginAction to pass some data back to that index.phtml? All of the examples I find for using Zend_Auth have each action associated with its own view. I want to have my indexAction using index.phtml AND I want to be able to use loginAction to pass data back to index.phtml as well.
For example, if the person fails to enter a username I want a small notice to appear above the username field in the form saying "You didn't enter a username!". However, since I am using loginAction to check this but I am displaying the info on index.phtml how do I get the action to pass the data to it? I suspect this is just me not getting object oriented programming but who knows. FYI, Previously I would have had the form's action point to something like authenticate.php which would have done the job and then set a variable indicating a problem and redirected back to the index page where the variable would be detected and the appropriate warning raised. I hope that is clear. |
|
|||
|
The cakephp folks have a brand new tutorial that (to a certain extent) deals with my problem! It is available here: http://bakery.cakephp.org/articles/v...her-controller
Now my problem is... I don't know jack about cake so all of the classes and methods they are calling are mysteries to me. How to translate it into zend framework? Hmmm... also, it seems so complicated! I mean, in the past you could do the checks they do in a couple of lines, set a session variable and be done with it. Is this really better? |
|
|||
|
The solution was to use the action helper flashMessenger. Initialize the helper in the controller's init, set the message in one action and retrieve it in another.
All in the manual, of course, but I had to wade through alot of stuff to finally get to it... ugh. **Erm... as a side note... this seems like a pretty slow forum when an easy question gets answered by the author a week after posting. Oh well... I got some good feedback on this issue over at Web Design Forums - List all forums. Those stuck with untouched questions here may prefer that forum. I now do. Last edited by PootyTang : 08-30-2007 at 05:37 AM. Reason: additional info |
![]() |
| Thread Tools | |
| Display Modes | |
|
|