Merge remote-tracking branch 'origin/5.1' into 5.1

This commit is contained in:
Taylor Otwell 2015-07-31 08:59:51 -05:00
commit 01e84501fd
2 changed files with 12 additions and 0 deletions

View File

@ -740,6 +740,16 @@ class BladeCompiler extends Compiler implements CompilerInterface
$this->customDirectives[$name] = $handler;
}
/**
* Get the list of custom directives.
*
* @return array
*/
public function getCustomDirectives()
{
return $this->customDirectives;
}
/**
* Gets the raw tags used by the compiler.
*

View File

@ -487,9 +487,11 @@ empty
public function testCustomStatements()
{
$compiler = new BladeCompiler($this->getFiles(), __DIR__);
$this->assertCount(0, $compiler->getCustomDirectives());
$compiler->directive('customControl', function ($expression) {
return "<?php echo custom_control{$expression}; ?>";
});
$this->assertCount(1, $compiler->getCustomDirectives());
$string = '@if($foo)
@customControl(10, $foo, \'bar\')