Zählen Zweig mit mehreren Parametern

Gibt es eine Möglichkeit, um ein Twig-template mit mehr als einem parameter?

Ich habe versucht, aber es hat nicht funktioniert:

Den folgenden Zweig gerendert, die durch meine Symfony-Controller:

{% for object in objects %}
        {% if object.type == "simple" %}
               {% include 'BBLWebBundle:content:simple.html.twig' 
                with [{'picture': object.picture}, {'link': object.link}, {'name': object.name}, {'info': object.info}] %}

        {% elseif object.type == "mp3" %}
                {% include 'BBLWebBundle:content:mp3.html.twig'
                with [{'picture': object.picture}, {'link': object.link}, {'name': object.name}, {'info': object.info}] %}

        {% elseif object.type == "video" %}
                {% include 'BBLWebBundle:content:video.html.twig' 
                with [{'picture': object.picture}, {'link': object.link}, {'name': object.name}, {'info': object.info}] %}
        {% endif %}
{% endfor %}    

Den Controller geht auch bei einigen Parametern (dies ist nur ein Teil der Dummy-Daten):

    $objects['ob1']['type'] = "simple";
    $objects['ob1']['picture'] = "this is a picture";
    $objects['ob1']['link'] = "#";
    $objects['ob1']['info'] = "Oh wooow some Info";
    $objects['ob1']['name'] = "Potato";
    return $this->render('BBLWebBundle:Base:content.html.twig',
            array('objects' => $objects, 'title' => "Im very cool Title"));

Dies ist ein Twig-template, das sollte enthalten sein:

<div>{{ picture }}</div> 
<div><a href="{{ link }}"> <h3>{{ name }}</h3></a><br />{{ info }}<br /></div>
InformationsquelleAutor Simeon | 2013-04-15
Schreibe einen Kommentar