crwork Posted October 16, 2012 Share Posted October 16, 2012 (edited) Learning the MVC framework was painful for me. Eventually, I began to understand it when I built my own site using CodeIgniter. I felt like I understood MVC enough at least on a rudimentary level. But wow, my current project uses elements of Zend and I am totally overwhelmed. It looks like another language to me and the documentation online isn't nearly as clear as for CodeIgniter. I'm sure plenty of people use it and love it, but to me it seems like it's adding another layer of complexity I don't have time to learn. Oh well, job security for a lot of people I guess. In any case, just on a basic level, I'm having some trouble finding decent documentation for newbs. I don't need to have a thorough command of Zend to get through my project, but it would be helpful to at least know a few things. If anyone can explain just a few tidbits, I'd appreciate it: 1) The Zend Registry: Are these considered session variables? The app I have uses this to set many variables, but if I dump $_SESSION there's nothing there. Are they stored in cookies? 2) User Authentication: My app has a function called "gettheUser" that contains this command: $user = Zend_Auth::getInstance()->getIdentity(); Since no parameters are being used, how does Zend know where to get the user's identity? Is there a database behind the scenes that automatically handles this? Thanks and apologies for my "duh"-ness. Edited October 16, 2012 by crwork Quote Link to comment https://forums.phpfreaks.com/topic/269550-overwhelmed-with-zend/ Share on other sites More sharing options...
shlumph Posted October 16, 2012 Share Posted October 16, 2012 1) Variables stored in Zend Registry are not persistent throughout HTTP requests. They are not stored in $_SESSION or cookies, it's more of a singletonish pattern. 2) You authenticate the user with Zend_Auth. There's different storage mechanisms, but the default is using $_SESSION or Zend_Auth_Storage_Session. If you don't know if the user has an identity yet, you should probably be using Zend_Auth::getInstance()->hasIdentity() before trying to get the actual user identity. Quote Link to comment https://forums.phpfreaks.com/topic/269550-overwhelmed-with-zend/#findComment-1385660 Share on other sites More sharing options...
crwork Posted October 16, 2012 Author Share Posted October 16, 2012 Ok, thanks for the info! Quote Link to comment https://forums.phpfreaks.com/topic/269550-overwhelmed-with-zend/#findComment-1385679 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.