sessions in ZF ?????

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

باتريك is I believe the Arabic for the my name (internet search of dubious accuracy) - my real name at least ;). It's Pádraic (Irish Gaelic) which is related to Patrick in English. The pronunciation in Irish is like paw-drek, only the k is actually a soft c. "Maugrim" is just my internet handle :).

For you options - a new instance would work, but a Registry is a bit safer. Zend_Service_Namespace may see a name change of the class before a 1.0 ZF release.

Have you tried implenting the Registry?

To pass an object from the bootstrap to all Controller classes you can use the Zend_Controller_Front object to inject it using:

Code: Select all

$front->setParam('registry', $registryObject);
In action methods on a Controller, you can then call:

Code: Select all

$registry = $this->getInvokeArg('registry');
This mechanism is easily used to pass any object from the bootstrap to any Controller in your application. In fact you can even skip using a Registry for less "global" objects and use the setParam/getInvokeArg pairing for all objects only a Controller needs access to. Sessions of course can be used in a few places, so a Registry is a bit more suitable in this case.
User avatar
the_last_tamurai
Forum Commoner
Posts: 87
Joined: Wed Feb 28, 2007 8:24 am
Location: cairo
Contact:

Post by the_last_tamurai »

To your real name yes , but to your internet name is مجرم try to search for it. :lol:

I'll try the registery now. after I finish I'll edit the post
Post Reply