Merge remote-tracking branch 'origin/5.1' into 5.1
This commit is contained in:
commit
01e84501fd
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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\')
|
||||
|
|
Loading…
Reference in New Issue