Skip to content

Commit

Permalink
Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
daylerees committed Feb 22, 2014
1 parent 9d55ea8 commit 6422dbb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build/src/Raincolour/Core/Processor.php
Original file line number Diff line number Diff line change
@@ -264,17 +264,33 @@ protected function buildOutputPath($pattern, $template, $theme)
*/
protected function buildFileName($name, $theme)
{
// If we have no theme name...
if ($name == null) {
// .. set it to the slug.
return $theme->get('theme.slug');
}

// Find variable substitution matches...
preg_match('/%(.+)%/i', $name, $matches);

// Iterate the matches...
foreach ($matches as $match) {

// Check for existance of marker...
if (strpos($match, '%') !== false) {

// Build a key for replacement.
$key = trim($match, '%');

// Get replacement value.
$value = $theme->get($key);

// Perform substitution.
$name = str_replace($match, $value, $name);
}
}

// Return new value.
return $name;
}
}

0 comments on commit 6422dbb

Please sign in to comment.