Zend_Auth and passing data (OO PHP noob)
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.
|