clickcoder / slim-blade

Blade is a simple, yet powerful templating engine provided for the Slim Framework
32 stars 10 forks source link

How to extend blade syntax with your package #5

Open gecbla opened 9 years ago

gecbla commented 9 years ago

In Laravel someone can easily write

Blade::extend(function($value) {
    return preg_replace('/\@define(.+)/', '<?php ${1}; ?>', $value);
});

for custom syntax

@define $i = 1

Is this possible with your package and how? Method extend exists only in class Illuminate\View\Compilers\BladeCompiler.php