Skip to content

Commit

Permalink
added minify_template() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Tessore committed Mar 4, 2015
1 parent ac702ff commit 3f37320
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SubstitutionTemplate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ class SubstitutionTemplate{
public function __construct(){

}


public function minify_template(){
$this->tpl = str_replace(array("\n", "\r"), '', $this->tpl);
$this->tpl = preg_replace('@ {2,}@', ' ', $this->tpl);
return $this;
}

/**
* Sets the substitutions template
* @param string $tpl the template
Expand Down

0 comments on commit 3f37320

Please sign in to comment.