Displaying 1 result from an estimated 1 matches for "smart_templ".
2011 Jul 21
0
Templates and self-knowledge
...e to make
decisions in the more general case. Otherwise, I end up with a bunch of
defines sprinkled all over my manifests, all of which do the same thing:
bring a value into the ERB scope as a named variable.
Of course, it just now occurred to me that I can create a define like this:
> define smart_template($module, $mode = 0644, $args = undef) {
>>
>> $this_filename = $name
>>
>> $this_short_filename = inline_template("<%=
>>> this_filename.split(/\//)[-1] %>")
>>
>> $template_file = "${module}/${this_short_filename}.erb"...