[jifty-devel] Difference Between alias and import_templates in Template::Declare

David E. Wheeler david at kineticode.com
Wed Oct 7 00:27:13 EDT 2009


Howdy,

Other than the ability to set "package variables" in aliases, I've  
found one other difference between aliases and imported templates: The  
invocant.

In imported templates, the invocant is an object blessed into the  
class into which the templates were imported.

In aliased templates, the invocant is an object blessed into the class  
from which the templates were aliased.

Is this an important distinction? The tests in t/aliasing.t and t/ 
importing.t demonstrate it quite clearly, but I'm wondering whether  
anyone ever noticed this or if it's necessary? To me, the behavior of  
aliases is a bit weird, since they're supposed to be like mixins.

Thanks,

David


More information about the jifty-devel mailing list