Quantcast
Channel: Grafikart | Derniers Sujets du forum
Viewing all articles
Browse latest Browse all 1542

Tutoriel Upload/Annotation

$
0
0

Bonjour,

Voila je rencontre un petit problème avec mon code. J'ai suivi le tuto pour pour uploader des images sur mon projet symfony, tout se déroule pour le mieux, l'upload se fait correctement, le fichier est bien dans le dossier précisé mais lorsque je veux afficher celle-ci dans une vue twig j'ai une erreur :
Cannot use object of type Symfony\Component\HttpFoundation\File\File as array . Je passe bien l'entité dans le contrôleur.

Ce que je fais

Décrivez ici votre code ou ce que vous cherchez à faire

{% extends "layout.html.twig" %}
{% block content %}<h3>Le {{ advert.date|date('d/m/Y') }}</h3><div class="well"><h4>Information : </h4><p> Adresse : {{ advert.user.address }}</p><p> Nombre d'enfants : {{ advert.nbchild }}</p><p> Contact : {{ advert.user.email }} / {{ advert.user.phone }}</p><h4> Description : </h4><p> {{advert.content}} </p><img src="{{asset(advert.file)}}"></div><a href="{{path('editadvert')}}" >Editer</a><a href="{{path('deleteadvert', {id:advert.id})}}">Supprimer</a><a href="{{path('planningsub', {id:advert.planning.id})}}">Inscription planning</a>

{% endblock %}

Ce que j'obtiens

J'obtiens une erreur apparemment sur cette ligne.

// if absolute or begins with /, we're done        if ($this->isAbsoluteUrl($versionedPath) || ($versionedPath && '/' === $versionedPath[0])) {            return $versionedPath;        }

Viewing all articles
Browse latest Browse all 1542

Trending Articles