Search code examples
phplaravelrevolution-slider

conflict with variable "title" in Laravel and Slider Revolution


I'm using Laravel 6.5 and I inserted the Slider Revolution in my blade template.

I'm getting the message and I don't know how to resolve it:

Facade\Ignition\Exceptions\ViewException
Use of undefined constant title - assumed 'title' (this will throw an Error in a future version of PHP) 

The laravel tells me that the line below is giving the problem:

tmp:'<span class="tp-bullet-img-wrap">  <span class="tp-bullet-image"></span></span><span class="tp-bullet-title">{{title}}</span>'

Has anyone experienced this problem and knows how to solve it?

I thank you for your help.


Solution

  • {{ $var }} echoes $var unescaped.
    @ escapes the curly brace for blade compilation.

    If you need to display a string that is wrapped in curly braces, you may escape the blade behavior by prefixing your text with an @ symbol :

     @{{title}}
    

    See the official documentation here