Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-21-2007, 07:13 AM
Junior Member
 
Join Date: Aug 2007
Location: N.E. Ohio, USA
Posts: 3
Question 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-21-2007, 04:34 PM
Junior Member
 
Join Date: Aug 2007
Location: N.E. Ohio, USA
Posts: 3
Default Well, here is an answer of sorts

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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-30-2007, 05:32 AM
Junior Member
 
Join Date: Aug 2007
Location: N.E. Ohio, USA
Posts: 3
Lightbulb Problem solved

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-31-2008, 05:04 AM
Junior Member
 
Join Date: May 2008
Posts: 1
Default

can u share the code or explain the method? I'm stuck there too... It seems this forum has no attention at all...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:05 PM.