Skip to content

Commit

Permalink
added {section} sections {/section}
Browse files Browse the repository at this point in the history
  • Loading branch information
matthes committed Jul 25, 2018
1 parent 4363c35 commit b3a3024
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/TextTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ public function __construct ($text="") {
*
* @param $enableSectionMode
*/
public function setSectionCallback(callable $sectionCallback)
public function setSectionCallback($sectionCallback)
{

$this->sectionCallback = $sectionCallback;
}


/**
* Set the default Filter
*
Expand Down Expand Up @@ -499,7 +501,7 @@ private function _runSection(&$context, $content, $cmdParam, $softFail)
}


private function _parseFunctionParameters (string $cmdParam, &$context, $softFail)
private function _parseFunctionParameters ($cmdParam, &$context, $softFail)
{
$paramArr = [];
$cmdParamRest = preg_replace_callback('/(?<name>[a-z0-9_]+)\s*=\s*(?<sval>((\"|\')(.*?)\4)|[a-z0-9\.\_]+)/i', function ($matches) use(&$paramArr, &$context, $softFail) {
Expand Down Expand Up @@ -614,6 +616,10 @@ public function loadTemplate ($template) {
return $this;
}

public function setTemplate($text)
{
$this->mTemplateText = $text;
}

/**
* Parse Tokens in Text (Search for $(name.subname.subname)) of
Expand Down

0 comments on commit b3a3024

Please sign in to comment.