[Templates] Assembling a list of css/js/meta tags for WRAPPERs

Bill Moseley moseley@hank.org
Wed, 2 Aug 2006 21:01:19 -0700


On Wed, Aug 02, 2006 at 07:51:13PM -0700, Randal L. Schwartz wrote:
> >>>>> "Bill" == Bill Moseley <moseley@hank.org> writes:
> 
> Bill>     page.style_sheet = [];
> 
> Bill>     MACRO include_style_sheet( name ) BLOCK;
> Bill>         css_found = 0;
> Bill>         FOR css = page.style_sheet;
> Bill>             IF css == name;
> Bill>                 css_found = 1;
> Bill>                 LAST;
> Bill>             END;
> Bill>         END;
> Bill>         page.style_sheet.push( name ) UNLESS css_found;
> Bill>     END;
> 
> Why are you using an array when a hash would be so much easier?

Sure, anyone can use a hash. ;)

Well, it's copied from code I used for loading javascript and I
wanted to load the javascript in a specific order.


-- 
Bill Moseley
moseley@hank.org