IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Symfony PHP Discussion :

affichage dans un datagrid (Extjs)


Sujet :

Symfony PHP

  1. #1
    Membre régulier
    Homme Profil pro
    Inscrit en
    Mars 2009
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Mars 2009
    Messages : 135
    Points : 110
    Points
    110
    Par défaut affichage dans un datagrid (Extjs)
    bonjour,
    j'ai crée une fonction dans mon contrôleur permet de récupérer une liste ,
    je veux l'afficher dans un datagrid (extjs4) .
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    public function testAction()
        {
             $request = $this->getRequest();
             $em = $this->container->get('doctrine')->getEntityManager();
                $categories = $em->getRepository('MyAppFilmothequeBundle:Categorie')->findAll();
                    $format = $request->getRequestFormat();
                    return $this->render('::index1.'.$format.'.twig', array('data' => array(
          'success' => true,
          'categories' => $categories,
     
        )));
    dans le routing , j'ai précisé le type de retour(json)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    myapp_accueil_test:
       pattern: /test
       defaults: { _controller: MyAppFilmothequeBundle:Default:test, _format: json }
    enfin pour l'affichage
    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
     
    // create the data store
        var store = Ext.create('Ext.data.ArrayStore', {
            model: 'Task',
            autoLoad: true,
            remoteSort: true,
            remoteGroup: true,
            proxy: {
                type: 'ajax',
                url: '{{path('myapp_accueil_test')}}',
                reader: {
                    type: 'json',
                    root: 'data'
                }
            }
        });
     
    // create the Grid
        var grid = Ext.create('Ext.grid.Panel', {
            store: store,
            stateful: true,
            collapsible: true,
            multiSelect: true,
            stateId: 'stateGrid',
            columns: [
                {
                    text     : 'Company',
                    flex     : 1,
                    sortable : false,
                    dataIndex: 'company'
                },
    ...

  2. #2
    Membre habitué Avatar de Avrel
    Homme Profil pro
    Développeur Web
    Inscrit en
    Avril 2010
    Messages
    118
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Avril 2010
    Messages : 118
    Points : 177
    Points
    177
    Par défaut
    Et quel est ton problème ?

  3. #3
    Membre régulier
    Homme Profil pro
    Inscrit en
    Mars 2009
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Mars 2009
    Messages : 135
    Points : 110
    Points
    110
    Par défaut
    il n'a rien afficher

  4. #4
    Membre averti

    Inscrit en
    Juin 2008
    Messages
    307
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 307
    Points : 364
    Points
    364
    Par défaut
    As tu des messages d'erreurs, des messages dans la log symfony ou autre ?

    As tu essayé de déboguer avec xdebug ou avec des traces ?

    Si non, passe au moins 30 minutes à le faire et indique nous les résultats de tes investigations...

    Olivier

  5. #5
    Membre régulier
    Homme Profil pro
    Inscrit en
    Mars 2009
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Mars 2009
    Messages : 135
    Points : 110
    Points
    110
    Par défaut
    voilà ce qui est affiché dans le navigateur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
     
    [{"message":"Unable to find template \"::index1.html.twig\".","class":"InvalidArgumentException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":136,"args":[]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"load","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":59,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"render","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":113,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"renderResponse","file":"C:\\wamp\\www\\Symfony2\\src\\MyApp\\FilmothequeBundle\\Controller\\DefaultController.php","line":33,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"MyApp\\FilmothequeBundle\\Controller","short_class":"DefaultController","class":"MyApp\\FilmothequeBundle\\Controller\\DefaultController","type":"->","function":"testAction","file":null,"line":null,"args":[]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func_array","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3925,"args":[["array",[["object","MyApp\\FilmothequeBundle\\Controller\\DefaultController"],["string","testAction"]]],["array",[]]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleRaw","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3895,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":4899,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Bundle\\FrameworkBundle","short_class":"HttpKernel","class":"Symfony\\Bundle\\FrameworkBundle\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\bootstrap.php.cache","line":551,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\web\\app_dev.php","line":27,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]},{"message":"Unable to find template \"::index1.html.twig\".","class":"Twig_Error_Loader","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader.php","line":82,"args":[]},{"namespace":"Symfony\\Bundle\\TwigBundle\\Loader","short_class":"FilesystemLoader","class":"Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader","type":"->","function":"findTemplate","file":"C:\\wamp\\www\\Symfony2\\vendor\\twig\\lib\\Twig\\Loader\\Filesystem.php","line":98,"args":[["string","::index1.html.twig"]]},{"namespace":"","short_class":"Twig_Loader_Filesystem","class":"Twig_Loader_Filesystem","type":"->","function":"getCacheKey","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":5955,"args":[["string","::index1.html.twig"]]},{"namespace":"","short_class":"Twig_Environment","class":"Twig_Environment","type":"->","function":"getTemplateClass","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":5998,"args":[["string","::index1.html.twig"],["null",null]]},{"namespace":"","short_class":"Twig_Environment","class":"Twig_Environment","type":"->","function":"loadTemplate","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":134,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"load","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":59,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"render","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":113,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"renderResponse","file":"C:\\wamp\\www\\Symfony2\\src\\MyApp\\FilmothequeBundle\\Controller\\DefaultController.php","line":33,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"MyApp\\FilmothequeBundle\\Controller","short_class":"DefaultController","class":"MyApp\\FilmothequeBundle\\Controller\\DefaultController","type":"->","function":"testAction","file":null,"line":null,"args":[]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func_array","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3925,"args":[["array",[["object","MyApp\\FilmothequeBundle\\Controller\\DefaultController"],["string","testAction"]]],["array",[]]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleRaw","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3895,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":4899,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Bundle\\FrameworkBundle","short_class":"HttpKernel","class":"Symfony\\Bundle\\FrameworkBundle\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\bootstrap.php.cache","line":551,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\web\\app_dev.php","line":27,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]},{"message":"Unable to find template \"::index1.html.twig\" : \"The file \"views\/index1.html.twig\" does not exist (in: C:\/wamp\/www\/Symfony2\/app\/Resources).\".","class":"InvalidArgumentException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":1577,"args":[]},{"namespace":"Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader","short_class":"TemplateLocator","class":"Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator","type":"->","function":"locate","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader.php","line":69,"args":[["object","Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference"]]},{"namespace":"Symfony\\Bundle\\TwigBundle\\Loader","short_class":"FilesystemLoader","class":"Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader","type":"->","function":"findTemplate","file":"C:\\wamp\\www\\Symfony2\\vendor\\twig\\lib\\Twig\\Loader\\Filesystem.php","line":98,"args":[["string","::index1.html.twig"]]},{"namespace":"","short_class":"Twig_Loader_Filesystem","class":"Twig_Loader_Filesystem","type":"->","function":"getCacheKey","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":5955,"args":[["string","::index1.html.twig"]]},{"namespace":"","short_class":"Twig_Environment","class":"Twig_Environment","type":"->","function":"getTemplateClass","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":5998,"args":[["string","::index1.html.twig"],["null",null]]},{"namespace":"","short_class":"Twig_Environment","class":"Twig_Environment","type":"->","function":"loadTemplate","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":134,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"load","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":59,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"render","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":113,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"renderResponse","file":"C:\\wamp\\www\\Symfony2\\src\\MyApp\\FilmothequeBundle\\Controller\\DefaultController.php","line":33,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"MyApp\\FilmothequeBundle\\Controller","short_class":"DefaultController","class":"MyApp\\FilmothequeBundle\\Controller\\DefaultController","type":"->","function":"testAction","file":null,"line":null,"args":[]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func_array","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3925,"args":[["array",[["object","MyApp\\FilmothequeBundle\\Controller\\DefaultController"],["string","testAction"]]],["array",[]]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleRaw","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3895,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":4899,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Bundle\\FrameworkBundle","short_class":"HttpKernel","class":"Symfony\\Bundle\\FrameworkBundle\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\bootstrap.php.cache","line":551,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\web\\app_dev.php","line":27,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]},{"message":"The file \"views\/index1.html.twig\" does not exist (in: C:\/wamp\/www\/Symfony2\/app\/Resources).","class":"InvalidArgumentException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3649,"args":[]},{"namespace":"Symfony\\Component\\Config","short_class":"FileLocator","class":"Symfony\\Component\\Config\\FileLocator","type":"->","function":"locate","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":4512,"args":[["string","views\/index1.html.twig"],["null",null],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel\\Config","short_class":"FileLocator","class":"Symfony\\Component\\HttpKernel\\Config\\FileLocator","type":"->","function":"locate","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":1575,"args":[["string","views\/index1.html.twig"],["null",null]]},{"namespace":"Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader","short_class":"TemplateLocator","class":"Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator","type":"->","function":"locate","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader.php","line":69,"args":[["object","Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference"]]},{"namespace":"Symfony\\Bundle\\TwigBundle\\Loader","short_class":"FilesystemLoader","class":"Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader","type":"->","function":"findTemplate","file":"C:\\wamp\\www\\Symfony2\\vendor\\twig\\lib\\Twig\\Loader\\Filesystem.php","line":98,"args":[["string","::index1.html.twig"]]},{"namespace":"","short_class":"Twig_Loader_Filesystem","class":"Twig_Loader_Filesystem","type":"->","function":"getCacheKey","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":5955,"args":[["string","::index1.html.twig"]]},{"namespace":"","short_class":"Twig_Environment","class":"Twig_Environment","type":"->","function":"getTemplateClass","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":5998,"args":[["string","::index1.html.twig"],["null",null]]},{"namespace":"","short_class":"Twig_Environment","class":"Twig_Environment","type":"->","function":"loadTemplate","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":134,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"load","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":59,"args":[["string","::index1.html.twig"]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"render","file":"C:\\wamp\\www\\Symfony2\\vendor\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\TwigEngine.php","line":113,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"Symfony\\Bundle\\TwigBundle","short_class":"TwigEngine","class":"Symfony\\Bundle\\TwigBundle\\TwigEngine","type":"->","function":"renderResponse","file":"C:\\wamp\\www\\Symfony2\\src\\MyApp\\FilmothequeBundle\\Controller\\DefaultController.php","line":33,"args":[["string","::index1.html.twig"],["array",{"data":["array",{"success":["boolean",true],"categories":["array",[["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"],["object","MyApp\\FilmothequeBundle\\Entity\\Categorie"]]]}]}]]},{"namespace":"MyApp\\FilmothequeBundle\\Controller","short_class":"DefaultController","class":"MyApp\\FilmothequeBundle\\Controller\\DefaultController","type":"->","function":"testAction","file":null,"line":null,"args":[]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func_array","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3925,"args":[["array",[["object","MyApp\\FilmothequeBundle\\Controller\\DefaultController"],["string","testAction"]]],["array",[]]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleRaw","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":3895,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\cache\\dev\\classes.php","line":4899,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Bundle\\FrameworkBundle","short_class":"HttpKernel","class":"Symfony\\Bundle\\FrameworkBundle\\HttpKernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\app\\bootstrap.php.cache","line":551,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"C:\\wamp\\www\\Symfony2\\web\\app_dev.php","line":27,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]}]

  6. #6
    Membre averti

    Inscrit en
    Juin 2008
    Messages
    307
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 307
    Points : 364
    Points
    364
    Par défaut
    et donc ce template est il au bon endroit ? As tu lu la doc sur les templates sur le site de symfony ?

  7. #7
    Membre régulier
    Homme Profil pro
    Inscrit en
    Mars 2009
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations forums :
    Inscription : Mars 2009
    Messages : 135
    Points : 110
    Points
    110
    Par défaut
    maintenant le navigateur affiche le contenu de la page index1.html.twig(c'est à dire le code) !

  8. #8
    Membre averti

    Inscrit en
    Juin 2008
    Messages
    307
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 307
    Points : 364
    Points
    364
    Par défaut
    que contient ce fichier ?

  9. #9
    Membre à l'essai
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    9
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 9
    Points : 11
    Points
    11
    Par défaut
    Je pense que ton problème viens de cette ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    return $this->render('::index1.'.$format.'.twig', array('data' => array(
          'success' => true,
          'categories' => $categories,
     
        )));
    Tu dis à ton controller de retourner la vue index1.html.twig et je pense que ce serai plus judicieux d'utiliser la classe Response car tu n'as pas besoin de template dans ce cas :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    return new Response(json_encode(array( 'success' => true, 'categories' => $categories)));
    Tu n'a pas besoin de préciser le header-content sachant que tu l'as déjà fait dans la définition de la route.

Discussions similaires

  1. Affichage dans un datagrid limité pour un seul matricule saisi
    Par Tayeb Chemingui dans le forum VB 6 et antérieur
    Réponses: 0
    Dernier message: 27/04/2011, 23h59
  2. Réponses: 1
    Dernier message: 31/07/2009, 08h12
  3. Réponses: 3
    Dernier message: 10/12/2007, 22h48
  4. Réponses: 2
    Dernier message: 17/11/2005, 09h59
  5. Réponses: 13
    Dernier message: 14/06/2004, 15h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo