Closed jmohler1970 closed 8 years ago
During a fit of insanity, you considered
// cfml
string function tag (required string tag_name, struct attr = {}, any innerHTML = []) {
if(!isArray(arguments.innerHTML)) arguments.innerHTML = [arguments.innerHTML];
writeOutput("<" & arguments.tag);
for (local.myAttr in arguments.attr) {
writeOutput(" " & lcase(local.myAttr) & '="' & arguments.attr(local.myAttr) & '"';
}
writeOutput(">");
for(local.myInnerHTML in arguments.innerHTML) {
writeOutput(local.myInnerHTML);
}
writeOutput("</" & arguments.tag & ">");
}
tag("p", { class = "help-block" },
tag("input", {class = "help-button", value = "Help"})
);
Or more particular
tag("column", "{ lg = 3, md = 4, sm = 3, xs =6 }", content);
Support for Bootstrap 4 xl will also be added
Maybe you need to be able to run it in function mode or in tag mode. Maybe this gets a huge
switch(arguments.tag) {}
statement.
column("lg = 3, md = 4, sm = 3, xs =6", content);
I don't like all this string manipulation. How about just straight JSON?
The sizing on b:column needs to be able to accept structs.
<b:column span = "{ lg = 3, md = 4, sm = 3, xs =6 }">Content</b:column>
It also needs to evaluate. Right now this is a string