Skip to content

Commit

Permalink
Merge pull request #17 from zsco/master
Browse files Browse the repository at this point in the history
Fix for Laravel 5.1
  • Loading branch information
kaidesu committed Jul 6, 2015
2 parents 2c00210 + d4bf136 commit c5b1c14
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Caffeinated/Themes/Components.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ public function register($name, $callback)
*/
protected function registerTag($method, $namespace = '')
{
$this->blade->extend(function($view, $compiler) use ($method, $namespace) {
$pattern = $compiler->createMatcher('component_'.$method);

$replace = '$1<?php echo '.$namespace.$method.'$2; ?>';

return preg_replace($pattern, $replace, $view);
$this->blade->directive('component_'.$method, function($view) use ($method,$namespace){
return '<?php echo '.$namespace.$method."$view; ?>";
});
}

Expand Down Expand Up @@ -208,4 +204,4 @@ public function __call($method, $parameters = array())
{
return $this->call($method, $parameters);
}
}
}

0 comments on commit c5b1c14

Please sign in to comment.