for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bavix\Flow\Directives;
use Bavix\Flow\Directive;
use Bavix\FlowNative\Extensions\Blocks;
class BlockDirective extends Directive
{
protected $extensions = [
'reset' => Blocks::RESET,
'append' => Blocks::APPEND,
'prepend' => Blocks::PREPEND,
];
/**
* @return string
*/
public function render(): string
$name = $this->data['name']['lexer']['fragment'];
$type = $this->data['type']['lexer']['fragment'] ?? 'reset';
return '<?php $this->ext->blocks()->start(\'' . $name . '\', \'' . $this->extensions[$type] . '\')?>';
}
public function endDirective(): string
return '<?php echo $this->ext->blocks()->end()?>';