How to change the default delimiter of Handlebars.js?

前端 未结 8 1826
半阙折子戏
半阙折子戏 2020-12-10 02:41

I need to use handlebars.js and I also use Blade template engine from Laravel (PHP Framework). The tags {{}} conflict with blade\'s placeholders that are exactly the same.

8条回答
  •  爱一瞬间的悲伤
    2020-12-10 02:55

    Instead of changing the delimiters you can create files with your handlebars templates in without the .blade extension. Just include these files in your blade template. E.g

    Blade Template File - template.blade.php

    @extends('master.template')
    
    @section('content')
    
        @include('handlebars-templates/some-template-name') 
    
    @stop
    

    some-template-name File - some-template-name.php

    
    

提交回复
热议问题