Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 6865d7c

Browse files
committed
making sure pattern state is populated in the template
1 parent 01de6ac commit 6865d7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/lib/PatternLab/Builder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ protected function generatePatterns() {
258258
if ($pathInfo["render"]) {
259259

260260
// get the rendered, escaped, and mustache pattern
261-
$this->generatePatternFile($pathInfo["patternSrcPath"].".mustache",$pathInfo["patternPartial"],$pathInfo["patternDestPath"]);
261+
$this->generatePatternFile($pathInfo["patternSrcPath"].".mustache",$pathInfo["patternPartial"],$pathInfo["patternDestPath"],$pathInfo["patternState"]);
262262

263263
}
264264

@@ -273,16 +273,18 @@ protected function generatePatterns() {
273273
* @param {String} the filename of the file to be rendered
274274
* @param {String} the pattern partial
275275
* @param {String} path where the files need to be written too
276+
* @param {String} pattern state
276277
*/
277-
private function generatePatternFile($f,$p,$path) {
278+
private function generatePatternFile($f,$p,$path,$state) {
278279

279280
// render the pattern and return it as well as the encoded version
280281
list($rf,$e) = $this->renderPattern($f,$p);
281282

282283
// the core footer isn't rendered as mustache but we have some variables there any way. find & replace.
283284
$rf = str_replace("{% patternPartial %}",$p,$rf);
284285
$rf = str_replace("{% lineage %}",json_encode($this->patternLineages[$p]),$rf);
285-
$rf = str_replace("{% lineager %}",json_encode($this->patternLineagesR[$p]),$rf);
286+
$rf = str_replace("{% lineageR %}",json_encode($this->patternLineagesR[$p]),$rf);
287+
$rf = str_replace("{% patternState %}",$state,$rf);
286288

287289
// figure out what to put in the css section
288290
$c = $this->enableCSS && isset($this->patternCSS[$p]) ? "true" : "false";

0 commit comments

Comments
 (0)