Bonjour
Je suis en train de m'exercer à symony2 et par conséquent je crée un petit site e-commerceJe n'arrive pas à afficher un produit, j'ai un message d'erreur :
J'ai bien suivi le process mais je ne vois pas où vient l'erreur. Aidez-moi svp.Unable to find template "ANEcommerceBundleroduits:index.html.twig" (looked into: C:\Program Files\EasyPHP-DevServer-14.1VC9\Ecommerce\app/Resources/views, C:\Program Files\EasyPHP-DevServer-14.1VC9\Ecommerce\vendor\symfony\symfony\src\Symfony\Bridge\Twig/Resources/views/Form).
Voici mes fichiers
1- ProduitsController.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <?php namespace AN\EcommerceBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class ProduitsController extends Controller { public function produitsAction() { return $this->render('ANEcommerceBundle:Produits:index.html.twig'); } }
2- Routing.yml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 an_ecommerce_homepage: path: / defaults: { _controller: ANEcommerceBundle:Produits:produits }
3- index.html.twig
4- base.html.twig
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 {% extends "ANEcommerceBundle::base.html.twig" %} {% block body %} <div class="container"> <div class="row"> <div class="span9"> <div class="row"> <div class="span5"> <img src="{{ asset('img/holder.png') }}" alt="DevAndClick" width="470" height="310"> </div> <div class="span4"> <h4>Item Brand and Category</h4> <h5>AB29837 Item Model</h5> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <h4>3.33</h4> <form action="panier.php"> <select name="qte" class="span1"> <option>1</option> </select> <div> <button class="btn btn-primary">Ajouter au panier</button> </div> </form> </div> </div> </div> </div> </div> {% endblock %}
5- parameters.yml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>{% block title %}Welcome!{% endblock %}</title> <link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}" /> <link rel="stylesheet" href="{{ asset('css/bootstrap-responsive.css') }}" /> <link rel="stylesheet" href="{{ asset('css/style.css') }}" /> <link rel="stylesheet" href="{{ asset('css/font-awesome.css') }}" /> {% block stylesheets %} {% endblock %} <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <button class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse" type="button"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="brand" href="index.php">DevAndClick</a> <div class="nav-collapse collapse"> <form class="navbar-form form-search pull-right"> <input id="Search" name="Search" type="text" class="input-medium search-query"> <button type="submit" class="btn">Rechercher</button> </form> </div> </div> </div> </div> {% block body %}{% endblock %} <hr /> <footer id="footer" class="vspace20"> <div class="container"> <div class="row"> <div class="span4 offset1"> <h4>Informations</h4> <ul class="nav nav-stacked"> <li><a href="texte.php">CGV</a> <li><a href="texte.php">Mentions légales</a> </ul> </div> <div class="span4"> <h4>Notre entrepôt</h4> <p><i class="icon-map-marker"></i> Paris 75 000 - 3 rue des jardins</p> </div> <div class="span2"> <h4>Nous contacter</h4> <p><i class="icon-phone"></i> Tel: 02 35 00 00 00</p> <p><i class="icon-print"></i> Fax: 02 35 00 00 00</p> </div> </div> <div class="row"> <div class="span4"> <p>© Copyright 2014 - DevAndClick</p> </div> </div> </div> </footer> </body> </html> <script src="{{ asset('js/jquery-1.10.0.min.js') }}"></script> <script src="{{ asset('js/bootstrap.js') }}"></script> {% block javascripts %}{% endblock %}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #This file is auto-generated during the composer install parameters: database_host: localhost database_port: null database_name: bd_ecommerce database_user: root database_password: null mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: null mailer_password: null secret: ThisTokenIsNotSoSecretChangeIt twig: globals: telephone: '02 35 00 00 00' fax: '02 35 00 00 00' adresse: 'Paris 75 000 - 3 rue des jardins' pathDefault: 'http://localhost/Ecommerce/web/'`
Partager