Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
HOTFIX: fixing print pattern function
Browse files Browse the repository at this point in the history
  • Loading branch information
daveredfern committed Nov 3, 2016
1 parent 66cb7dd commit 55260ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@
define('DS', DIRECTORY_SEPARATOR);

function get($location, $options=array()) {
$location = 'pattern/' . $location;

if(substr($location, -1) === '/') {
$path = TEMPLATE_PATH . trim($location, '/');
$files = recurseDir($location, $path);
}
else {
$parts = explode('/', trim($location, '/'));

$last = array_pop($parts);
$parts[] = "*".$last.".php";
$path = TEMPLATE_PATH . implode('/', $parts);

$path = TEMPLATE_PATH . implode('/', $parts);

$filestocheck = glob($path);
$files = array();
foreach ($filestocheck as $f) {
Expand All @@ -25,6 +30,7 @@ function get($location, $options=array()) {
}
}
}

return getContents($files, $options);
}

Expand Down
2 changes: 1 addition & 1 deletion pattern/demo/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Title: Header
*/ ?>

<?php printPattern('molecule/logo'); ?>
<?php printPattern('component/logo'); ?>

0 comments on commit 55260ff

Please sign in to comment.