1
votes
 {% for item in product %}
        <tr>
            <td class="col-lg-5" >   <a href="/findname/{{ item.maspct }}"><h5> {{ item.tensp}}</h5></a></td>
            <td class="col-lg-12"> {{ item.thanhphan}}</td>
            <td class="col-lg-12"> {{ item.gia}}</td>
         line 19   <td class="col-lg-12">   <img src="{{asset('/bundles/image/'{item.hinh})}}"  alt=""/></td>

        </tr>            
             {% endfor %} 

I got this error message in Symfony Arguments must be separated by a comma. Unexpected token "punctuation" of value "{" ("punctuation" expected with value ",") in SP\findall.html.twig at line 19. how can i fix it

1

1 Answers

2
votes

Try concat string with ~ operator.

{% for item in product %}
    <tr>
        <td class="col-lg-5" ><a href="/findname/{{ item.maspct }}"><h5> {{ item.tensp}}</h5></a></td>
        <td class="col-lg-12">{{ item.thanhphan}}</td>
        <td class="col-lg-12">{{ item.gia }}</td>
        <td class="col-lg-12"><img src="{{ asset('/bundles/image/' ~ item.hinh)}}" alt=""/></td>
    </tr>            
{% endfor %}