Welcome Guest, Not a member yet? Register   Sign In
code in controller destruct
#1

[eluser]Unknown[/eluser]
Is it generally considered a bad practice to put necessary code in the __destruct function?

Basically, every controller of mine has several function calls and other housework that needs to be done at the very end of processing (such as saving cookie data, updating views, and so on).

But, from my knowledge, the destructor isn't always called, so I'd need to have every controller function call __destruct, but this seems a bit hackish. Is there a better way I can go about getting my controller functions to do something similar without messing around with destruct?
#2

[eluser]Randy Casburn[/eluser]
[quote author="Anti_dentite" date="1224624396"]But, from my knowledge, the destructor isn't always called[/quote]

Please explain...your understanding of this may be incorrect.




Theme © iAndrew 2016 - Forum software by © MyBB