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

David E. Wheeler david at kineticode.com
Tue Oct 13 20:46:08 EDT 2009

On Oct 13, 2009, at 5:04 PM, David E. Wheeler wrote:

> So if it's okay with you and everyone else, I think I'd like to stick
> with `mix`. Unless you all prefer the original `alias` method. I'd be
> fine with that. Then it'd just be `import_templates` that'd be
> deprecated.

`include` might be another option. So, the examples:

     mix Some::Clever::Mixin      under '/mixin';
     mix Some::Other::Mixin       under '/otmix', setting { name =>  
'Larry' };
     mix My::Mixin into My::View, under '/mymix';

     alias Some::Clever::Mixin      under '/alias';
     alias Some::Other::Mixin       under '/otalias', setting { name  
=> 'Larry' };
     alias My::Mixin in My::View,   under '/myalias';

     include Some::Clever::Mixin      under '/included';
     include Some::Other::Mixin       under '/otincluded', setting  
{ name => 'Larry' };
     include My::Mixin in My::View,   under '/myincluded';

I think I still prefer `mix`: it's shortest, easy to explain, and can  
use `into` instead of `in` for the class into which it mixes.



More information about the jifty-devel mailing list