Skip to content

Commit b2e65c2

Browse files
committed
up: add new method for glob match render files
1 parent bef1316 commit b2e65c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Extra/FileTreeBuilder.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,22 @@ public function dirFiles(string $name, string ...$files): self
253253
});
254254
}
255255

256+
/**
257+
* Render template files by glob match.
258+
*
259+
* @param string $pattern
260+
* @param array $tplVars
261+
*
262+
* @return $this
263+
*/
264+
public function globRender(string $pattern, array $tplVars = []): self
265+
{
266+
foreach (glob($pattern) as $tplFile) {
267+
$this->tplFile($tplFile, '', $tplVars);
268+
}
269+
return $this;
270+
}
271+
256272
/**
257273
* Create file from a template file
258274
*

0 commit comments

Comments
 (0)