Skip to content
Snippets Groups Projects
Commit 17c3288d authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Implemented defaults in the templating system

parent 219b9fde
No related branches found
No related tags found
No related merge requests found
......@@ -67,8 +67,12 @@ sub templateReplace
while (my ($entireMacro,$section,$item,$default) = ($string =~ /(\%{([a-z]+)\.([a-z0-9\-]+)(?:=([^}]+))?})/i )) {
# Replace macro with ?
$string =~ s/$entireMacro/\?/;
# Get value to substitute
my $value = defined($hashref->{$section}->{$item}) ? $hashref->{$section}->{$item} : $default;
# Add value onto our array
push(@valueArray,$hashref->{$section}->{$item});
push(@valueArray,$value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment