Hi there,
I have created a custom module that, among other things, has a translate method. So in my templates, I call it using:
{exp:module:translate}String to translate{/exp:module:translate}
Trouble is that with every instance of this tag, there is a new object being initialized. Is there a setting to keep the object alive and reuse it?
Is EE creating the object, running the method, then destroying the object?
I had a look through the forums but I couldnt find anything similar.
Thanks.
Moved to Development and Programming by Moderator
Thanks Sue,
I was trying to get a bead on how objects are handled with EE, regarding creation and usage. From the looks of it, for every call to that tag, a new object is being created?
I was just wondering if there was a way to stipulate the module as a singleton, so that every call within the template uses the same instance?
Each tag will be its own instance but you can use static variables to pass data between the instances.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.