Skip to content

Commit

Permalink
Only word characters, numbers, . (dot) and _
Browse files Browse the repository at this point in the history
E.g. arrays (Hash::flatten'ed) to be used in substitutions.

This allows for the standard . notation of arrays to be used within substitions like
attendee.fistname and event.name from e.g. Hash::flatten($entity->toArray());
  • Loading branch information
hmic committed Jul 8, 2015
1 parent fa01bb1 commit c4ce721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/StringTemplate.php
Expand Up @@ -178,7 +178,7 @@ protected function _compileTemplates(array $templates = [])
$this->_compiled[$name] = [null, null];
}

preg_match_all('#\{\{(\w+)\}\}#', $template, $matches);
preg_match_all('#\{\{([\w\d\._]+)\}\}#', $template, $matches);
$this->_compiled[$name] = [
str_replace($matches[0], '%s', $template),
$matches[1]
Expand Down

0 comments on commit c4ce721

Please sign in to comment.