Closed gillesmk closed 10 years ago
I'd prefer to keep the basic HamlCompiler class more generic. What if you subclassed it with a new BladeHamlCompiler
class that adds your new logic (which looks sound, thanks for all the comments and organization)? Then, in the service provider, you add a new addExtension
call that looks for files that end in 'blade.haml.php', 'blade.haml', 'haml.blade', and 'haml.blade.php' and uses your new BladeHamlCompiler
class to resolve the view, instead of the basic HamlCompiler
.
Yes sure it sounds more logical.
I’ll work on something more haml friendly. Using indention to get section blocks rather than having view_section and view_stop. I’ll do an extension of yours in separate repo.
Thanks for feedback and for the library
m k
Gilles Boisson Web Developer Manythink Office: +32 2 559 01 64 Fax: +32 2 527 57 59 55 rue des Anciens Étangs B-1190 Brussels gilles@manythink.be (mailto:remy@manythink.be) www.manythink.be (http://www.manythink.be)
Le lundi 30 juin 2014 à 18:22, Robert Reinhard a écrit :
I'd prefer to keep the basic HamlCompiler class more generic. What if you subclassed it with a new BladeHamlCompiler class that adds your new logic (which looks sound, thanks for all the comments and organization). Then, in the service provider, you add a new addExtension call that looks for files that end in 'blade.haml.php', 'blade.haml', 'haml.blade', and 'haml.blade.php' and uses the new BladeHamlCompilerclass to resolve the view, instead of the basic HamlCompiler.
— Reply to this email directly or view it on GitHub (https://github.com/BKWLD/laravel-haml/pull/10#issuecomment-47552714).
Cool. I'll close this for now until those changes are ready.
Based on blade Templating system I had the support of layout / include / yield feature. calling a php function with the view_ prefix will do it's equivalent in blade. All Blade @ prefixed function are supported appart from stuff like test and loop (eg. @for, @foreach)
View
Layout