Короткие коды переменных шаблона Twig не отображаются - PullRequest
0 голосов
/ 06 мая 2019

Я настроил в своем домашнем контроллере свойства. Теперь, когда я пытаюсь отобразить свои значения, используя короткие коды шаблонов веток, ничего не отображается. Любая помощь?

Я настроил в своем домашнем контроллере свойства:

    public function index(PropertiesRepository $repository): Response {

    $properties = $repository->findLatest();
    // No longer necessary to use this method since we now use the AbstractController
    // return new Response($this->twig->render('pages/home.html.twig'));

    return $this->render('pages/home.html.twig', [
        'properties' => $properties
    ]);

}

Вот мой код шаблона ветки, обратите внимание, что я уже пробовал необработанный фильтр, но безуспешно:

    <div class="row">
        {% for property in properties %}
            <div class="col-3">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title"><a href="">{{ property.title | raw }}</a></h5>
                        {{ property.bedrooms | raw }}
                        <p class="card-text">{{ property.city | raw }} ({{ property.postalCode | raw }})</p>
                        <div class="text-primary">{{ property.formatedPrice | raw }} €</div>
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
...