View Single Post
Old 05-29-2008, 04:23 PM   #1 (permalink)
delayedinsanity
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default Unsetting an object from within itself

This may be pretty basic, but I can't think of how right now. I'm wondering if I can unset an object when a specific method is called (no, not __destruct, I don't want to have to unset() it for the method to do what it needs to do). I've been playing around with building a small template class so that I can remove all email message bodies from the program logic and have them placed in seperate .tpl files, along with some common menu's etc. So when I call my class, I do something to this effect;

PHP Code:
$pTmpl tuatara::load('functions''template'$szFilename);

$pTmpl->set('username',   $pSession->whoAmI('username'));
$pTmpl->set('profileURL'URL_USERINFO);
$pTmpl->set('adminURL',   URL_ADMIN);
$pTmpl->set('logoutURL',  URL_LOGOUT);

echo 
$pTmpl->parse(); 
What I want it to do is unset the $pTmpl object when parse() is called, instead of calling unset($pTmpl); after the fact - sounds lazy? Probably, but I'm just curious if I can do it.
-m
delayedinsanity is offline  
Reply With Quote