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

MVC PHP Discussion :

Problème de module, route et contrôleur


Sujet :

MVC PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    25
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mars 2006
    Messages : 25
    Par défaut Problème de module, route et contrôleur
    Bonjour,

    Je rencontre sur un problème depuis quelques temps. Après l'avoir "repoussé", avoir cherché, je l'expose.

    =>Brièvement : j'ai 2 modules (site et admin), je n'arrive pas à accéder aux contrôleurs du module admin (sans doute à cause de mes routes).

    =>En detail :
    j'ai donc deux modules : site et admin. "site" étant pour le front office et "admin" pour l'administration. Mes controleurs sont dans /application/[moduleX]/controllers/ (et les vues dans /application/[moduleX]/views/script/[controllerY]/[fichier.tpl] => le tpl est paramètre ok)

    J'accède au différentes URL grace à des routes configurées. Elles fonctionnent bien pour le site, là où j'ai eu un problème, ça a été pour l'admin.
    J'ai donc ajouté cette route là :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    $route = new Zend_Controller_Router_Route( 'admin/*', array('module' => 'admin'));
    $router->addRoute('admin', $route);
    Elle semblait bien fonctionner (un appelle à http://localhost/admin/ chargait l'action index du controller index du module admin), mais j'ai voulu appeler http://localhost/admin/actualite/ajouter, et là c'est le drame, c'est le index/index qui est chargé !
    J'ai modifié la route en
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    $route = new Zend_Controller_Router_Route( 'admin/:controller/:action/*', array('module' => 'admin'));
    $router->addRoute('admin', $route);
    La conséquence est que je ne peux plus accéder aux contrôleurs du module admin. Le message d'erreur :
    Code x : 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
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    Page introuvable
    
    retour
    DEBUG INFOS :
    Exception de type Zend_Controller_Dispatcher_Exception Invalid controller specified (actualite) envoy�e dans /Users/nicolas/SUPINFO/stage_XXXX/XXXX/site/application/lib/Zend/Controller/Dispatcher/Standard.php � la ligne 249
    Stack Trace :
    
    object(Zend_Controller_Dispatcher_Exception)#32 (6) {
      ["message:protected"] => string(40) "Invalid controller specified (actualite)"
      ["string:private"] => string(0) ""
      ["code:protected"] => int(0)
      ["file:protected"] => string(104) "/Users/nicolas/SUPINFO/stage_XXXX/XXXX/site/application/lib/Zend/Controller/Dispatcher/Standard.php"
      ["line:protected"] => int(249)
      ["trace:private"] => array(2) {
        [0] => array(6) {
          ["file"] => string(90) "/Users/nicolas/SUPINFO/stage_XXX/XXX/site/application/lib/Zend/Controller/Front.php"
          ["line"] => int(914)
          ["function"] => string(8) "dispatch"
          ["class"] => string(35) "Zend_Controller_Dispatcher_Standard"
          ["type"] => string(2) "->"
          ["args"] => array(2) {
            [0] => object(Zend_Controller_Request_Http)#30 (14) {
              ["_paramSources:protected"] => array(2) {
                [0] => string(4) "_GET"
                [1] => string(5) "_POST"
              }
              ["_requestUri:protected"] => string(24) "/admin/actualite/ajouter"
              ["_baseUrl:protected"] => string(0) ""
              ["_basePath:protected"] => NULL
              ["_pathInfo:protected"] => string(24) "/admin/actualite/ajouter"
              ["_params:protected"] => array(4) {
                ["controller"] => string(9) "actualite"
                ["action"] => string(7) "ajouter"
                ["module"] => string(5) "admin"
                ["error_handler"] => object(ArrayObject)#33 (3) {
                  ["exception"] => object(Zend_Controller_Dispatcher_Exception)#32 (6) {
                    ["message:protected"] => string(40) "Invalid controller specified (actualite)"
                    ["string:private"] => string(0) ""
                    ["code:protected"] => int(0)
                    ["file:protected"] => string(104) "/Users/nicolas/SUPINFO/stage_XXXX/XXXX/site/application/lib/Zend/Controller/Dispatcher/Standard.php"
                    ["line:protected"] => int(249)
                    ["trace:private"] => array(2) {
                      [0] => array(6) {
                        ["file"] => string(90) "/Users/nicolas/SUPINFO/stage_XXX/XXX/site/application/lib/Zend/Controller/Front.php"
                        ["line"] => int(914)
                        ["function"] => string(8) "dispatch"
                        ["class"] => string(35) "Zend_Controller_Dispatcher_Standard"
                        ["type"] => string(2) "->"
                        ["args"] => array(2) {
                          [0] => object(Zend_Controller_Request_Http)#30 (14) {
                            ["_paramSources:protected"] => array(2) {
                              [0] => string(4) "_GET"
                              [1] => string(5) "_POST"
                            }
                            ["_requestUri:protected"] => string(24) "/admin/actualite/ajouter"
                            ["_baseUrl:protected"] => string(0) ""
                            ["_basePath:protected"] => NULL
                            ["_pathInfo:protected"] => string(24) "/admin/actualite/ajouter"
                            ["_params:protected"] => array(4) {
                              ["controller"] => string(9) "actualite"
                              ["action"] => string(7) "ajouter"
                              ["module"] => string(5) "admin"
                              ["error_handler"] => object(ArrayObject)#33 (3) {
                                ["exception"] => *RECURSION*
                                ["type"] => string(23) "EXCEPTION_NO_CONTROLLER"
                                ["request"] => object(Zend_Controller_Request_Http)#34 (14) {
                                  ["_paramSources:protected"] => array(2) {
                                    [0] => string(4) "_GET"
                                    [1] => string(5) "_POST"
                                  }
                                  ["_requestUri:protected"] => string(24) "/admin/actualite/ajouter"
                                  ["_baseUrl:protected"] => string(0) ""
                                  ["_basePath:protected"] => NULL
                                  ["_pathInfo:protected"] => string(24) "/admin/actualite/ajouter"
                                  ["_params:protected"] => array(3) {
                                    ["controller"] => string(9) "actualite"
                                    ["action"] => string(7) "ajouter"
                                    ["module"] => string(5) "admin"
                                  }
                                  ["_aliases:protected"] => array(0) {
                                  }
                                  ["_dispatched:protected"] => bool(true)
                                  ["_module:protected"] => string(5) "admin"
                                  ["_moduleKey:protected"] => string(6) "module"
                                  ["_controller:protected"] => string(9) "actualite"
                                  ["_controllerKey:protected"] => string(10) "controller"
                                  ["_action:protected"] => string(7) "ajouter"
                                  ["_actionKey:protected"] => string(6) "action"
                                }
                              }
                            }
                            ["_aliases:protected"] => array(0) {
                            }
                            ["_dispatched:protected"] => bool(true)
                            ["_module:protected"] => string(7) "default"
                            ["_moduleKey:protected"] => string(6) "module"
                            ["_controller:protected"] => string(5) "error"
                            ["_controllerKey:protected"] => string(10) "controller"
                            ["_action:protected"] => string(5) "error"
                            ["_actionKey:protected"] => string(6) "action"
                          }
                          [1] => object(Zend_Controller_Response_Http)#31 (8) {
                            ["_body:protected"] => array(1) {
                              ["error"] => string(69) "<p>Page introuvable</p><a href="javascript:history.back()">retour</a>"
                            }
                            ["_exceptions:protected"] => array(1) {
                              [0] => *RECURSION*
                            }
                            ["_headers:protected"] => array(0) {
                            }
                            ["_headersRaw:protected"] => array(0) {
                            }
                            ["_httpResponseCode:protected"] => int(404)
                            ["_isRedirect:protected"] => bool(false)
                            ["_renderExceptions:protected"] => bool(false)
                            ["headersSentThrowsException"] => bool(true)
                          }
                        }
                      }
                      [1] => array(6) {
                        ["file"] => string(65) "/Users/nicolas/SUPINFO/stage_XXXX/XXXX/site/htdocs/index.php"
                        ["line"] => int(173)
                        ["function"] => string(8) "dispatch"
                        ["class"] => string(21) "Zend_Controller_Front"
                        ["type"] => string(2) "->"
                        ["args"] => array(0) {
                        }
                      }
                    }
                  }
                  ["type"] => string(23) "EXCEPTION_NO_CONTROLLER"
                  ["request"] => object(Zend_Controller_Request_Http)#34 (14) {
                    ["_paramSources:protected"] => array(2) {
                      [0] => string(4) "_GET"
                      [1] => string(5) "_POST"
                    }
                    ["_requestUri:protected"] => string(24) "/admin/actualite/ajouter"
                    ["_baseUrl:protected"] => string(0) ""
                    ["_basePath:protected"] => NULL
                    ["_pathInfo:protected"] => string(24) "/admin/actualite/ajouter"
                    ["_params:protected"] => array(3) {
                      ["controller"] => string(9) "actualite"
                      ["action"] => string(7) "ajouter"
                      ["module"] => string(5) "admin"
                    }
                    ["_aliases:protected"] => array(0) {
                    }
                    ["_dispatched:protected"] => bool(true)
                    ["_module:protected"] => string(5) "admin"
                    ["_moduleKey:protected"] => string(6) "module"
                    ["_controller:protected"] => string(9) "actualite"
                    ["_controllerKey:protected"] => string(10) "controller"
                    ["_action:protected"] => string(7) "ajouter"
                    ["_actionKey:protected"] => string(6) "action"
                  }
                }
              }
              ["_aliases:protected"] => array(0) {
              }
              ["_dispatched:protected"] => bool(true)
              ["_module:protected"] => string(7) "default"
              ["_moduleKey:protected"] => string(6) "module"
              ["_controller:protected"] => string(5) "error"
              ["_controllerKey:protected"] => string(10) "controller"
              ["_action:protected"] => string(5) "error"
              ["_actionKey:protected"] => string(6) "action"
            }
            [1] => object(Zend_Controller_Response_Http)#31 (8) {
              ["_body:protected"] => array(1) {
                ["error"] => string(69) "<p>Page introuvable</p><a href="javascript:history.back()">retour</a>"
              }
              ["_exceptions:protected"] => array(1) {
                [0] => object(Zend_Controller_Dispatcher_Exception)#32 (6) {
                  ["message:protected"] => string(40) "Invalid controller specified (actualite)"
                  ["string:private"] => string(0) ""
                  ["code:protected"] => int(0)
                  ["file:protected"] => string(104) "/Users/nicolas/SUPINFO/stage_XXX/XXX/site/application/lib/Zend/Controller/Dispatcher/Standard.php"
                  ["line:protected"] => int(249)
                  ["trace:private"] => array(2) {
                    [0] => array(6) {
                      ["file"] => string(90) "/Users/nicolas/SUPINFO/stage_XXX/XXXX/site/application/lib/Zend/Controller/Front.php"
                      ["line"] => int(914)
                      ["function"] => string(8) "dispatch"
                      ["class"] => string(35) "Zend_Controller_Dispatcher_Standard"
                      ["type"] => string(2) "->"
                      ["args"] => array(2) {
                        [0] => object(Zend_Controller_Request_Http)#30 (14) {
                          ["_paramSources:protected"] => array(2) {
                            [0] => string(4) "_GET"
                            [1] => string(5) "_POST"
                          }
                          ["_requestUri:protected"] => string(24) "/admin/actualite/ajouter"
                          ["_baseUrl:protected"] => string(0) ""
                          ["_basePath:protected"] => NULL
                          ["_pathInfo:protected"] => string(24) "/admin/actualite/ajouter"
                          ["_params:protected"] => array(4) {
                            ["controller"] => string(9) "actualite"
                            ["action"] => string(7) "ajouter"
                            ["module"] => string(5) "admin"
                            ["error_handler"] => object(ArrayObject)#33 (3) {
                              ["exception"] => *RECURSION*
                              ["type"] => string(23) "EXCEPTION_NO_CONTROLLER"
                              ["request"] => object(Zend_Controller_Request_Http)#34 (14) {
                                ["_paramSources:protected"] => array(2) {
                                  [0] => string(4) "_GET"
                                  [1] => string(5) "_POST"
                                }
                                ["_requestUri:protected"] => string(24) "/admin/actualite/ajouter"
                                ["_baseUrl:protected"] => string(0) ""
                                ["_basePath:protected"] => NULL
                                ["_pathInfo:protected"] => string(24) "/admin/actualite/ajouter"
                                ["_params:protected"] => array(3) {
                                  ["controller"] => string(9) "actualite"
                                  ["action"] => string(7) "ajouter"
                                  ["module"] => string(5) "admin"
                                }
                                ["_aliases:protected"] => array(0) {
                                }
                                ["_dispatched:protected"] => bool(true)
                                ["_module:protected"] => string(5) "admin"
                                ["_moduleKey:protected"] => string(6) "module"
                                ["_controller:protected"] => string(9) "actualite"
                                ["_controllerKey:protected"] => string(10) "controller"
                                ["_action:protected"] => string(7) "ajouter"
                                ["_actionKey:protected"] => string(6) "action"
                              }
                            }
                          }
                          ["_aliases:protected"] => array(0) {
                          }
                          ["_dispatched:protected"] => bool(true)
                          ["_module:protected"] => string(7) "default"
                          ["_moduleKey:protected"] => string(6) "module"
                          ["_controller:protected"] => string(5) "error"
                          ["_controllerKey:protected"] => string(10) "controller"
                          ["_action:protected"] => string(5) "error"
                          ["_actionKey:protected"] => string(6) "action"
                        }
                        [1] => object(Zend_Controller_Response_Http)#31 (8) {
                          ["_body:protected"] => array(1) {
                            ["error"] => string(69) "<p>Page introuvable</p><a href="javascript:history.back()">retour</a>"
                          }
                          ["_exceptions:protected"] => array(1) {
                            [0] => *RECURSION*
                          }
                          ["_headers:protected"] => array(0) {
                          }
                          ["_headersRaw:protected"] => array(0) {
                          }
                          ["_httpResponseCode:protected"] => int(404)
                          ["_isRedirect:protected"] => bool(false)
                          ["_renderExceptions:protected"] => bool(false)
                          ["headersSentThrowsException"] => bool(true)
                        }
                      }
                    }
                    [1] => array(6) {
                      ["file"] => string(65) "/Users/nicolas/SUPINFO/stage_XXX/XXXX/site/htdocs/index.php"
                      ["line"] => int(173)
                      ["function"] => string(8) "dispatch"
                      ["class"] => string(21) "Zend_Controller_Front"
                      ["type"] => string(2) "->"
                      ["args"] => array(0) {
                      }
                    }
                  }
                }
              }
              ["_headers:protected"] => array(0) {
              }
              ["_headersRaw:protected"] => array(0) {
              }
              ["_httpResponseCode:protected"] => int(404)
              ["_isRedirect:protected"] => bool(false)
              ["_renderExceptions:protected"] => bool(false)
              ["headersSentThrowsException"] => bool(true)
            }
          }
        }
        [1] => array(6) {
          ["file"] => string(65) "/Users/nicolas/SUPINFO/stage_XXX/XXX/site/htdocs/index.php"
          ["line"] => int(173)
          ["function"] => string(8) "dispatch"
          ["class"] => string(21) "Zend_Controller_Front"
          ["type"] => string(2) "->"
          ["args"] => array(0) {
          }
        }
      }
    }

    Voila mon fichier index.php (le bootstrap je crois):
    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
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
     
    <?
     
    error_reporting(E_ALL|E_STRICT);
     
    date_default_timezone_set('Europe/Paris');
    ini_set('include_path', '.'
        . PATH_SEPARATOR . '../application/lib'
        . PATH_SEPARATOR . '../application/modules/site/models/'
        . PATH_SEPARATOR . '../application/modules/admin/models/'
        . PATH_SEPARATOR . ini_get('include_path') );
     
    include "Zend/Loader.php";
    Zend_Loader::loadClass('Zend_Cache');
    Zend_Loader::loadClass('Zend_Db_Table_Abstract');
     
    Zend_Loader::loadClass('Zend_Registry');
    Zend_Loader::loadClass('Zend_Log');
    Zend_Loader::loadClass('Zend_Log_Writer_Stream');
     
    $writer = new Zend_Log_Writer_Stream('../application/log/fichier_log.log');
    $logger = new Zend_Log($writer);
     
    Zend_Registry::set('logger',$logger);
     
    //Zend_Log::registerLogger(new Zend_Log_Writer_Stream('../application/log/fichier_log.log'));
    //Zend_Log::setMessagePrefix('['. date('Y-m-d G:i') . '] ' . $_SERVER['REMOTE_ADDR'] . ': ');
     
     
    /*
    //INITIALISAION DU CACHE
    //A METTRE EN PRODUCTION
    $logger->log("Debut creation du cache", Zend_Log::DEBUG);
    $cache_bdd = Zend_Cache::factory('Core', 'File', array('lifetime'=>7200), array('cache_dir' => '../application/var/cache/'));
    Zend_Db_Table_Abstract::setDefaultMetadataCache($cache_bdd);
    
    
    $frontendOptions = array(
       'lifetime' => 7200,
       'debug_header' => true, // for debugging
       'regexps' => array(
    		   '^/$' => array('cache' => true),
    		   '^/contact' => array('cache' => true),
    		   '^/credits' => array('cache' => true),
    		   '^/aide' => array('cache' => true),
    		   '^/droit' => array('cache' => true),
    		   /*'^/article/' => array('cache' => false), // we don't cache the ArticleController...
    		   '^/article/view/' => array(              // ...but we cache the "view" action of
    			   'cache' => true,                     // this ArticleController
    			   'cache_with_post_variables' => true,    // and we cache even there are some variables in $_POST
    			   'make_id_with_post_variables' => true,   // (but the cache will be dependent of the $_POST array)
    		   )/
       )
    );
    $backendOptions = array(
        'cache_dir' => '../application/var/cache/'
    );
    
    $cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
    $logger->log("Fin creation du cache", Zend_Log::DEBUG);
    $logger->log("Demarrage du cache", Zend_Log::DEBUG);
    $cache->start();
    */
     
     
    Zend_Loader::loadClass('Zend_Auth');
    Zend_Loader::loadClass('Zend_Config_Ini');
    Zend_Loader::loadClass('Zend_Controller_Front');
    Zend_Loader::loadClass('Zend_Controller_Router_Rewrite');
    Zend_Loader::loadClass('Zend_Controller_Router_Route');
    Zend_Loader::loadClass('Zend_Controller_Router_Route_Regex');
    Zend_Loader::loadClass('Zend_Controller_Router_Route_Module');
    Zend_Loader::loadClass('Zend_Controller_Router_Route_Static');
    Zend_Loader::loadClass('Zend_Db');
    Zend_Loader::loadClass('Zend_Db_Table_Row_Abstract');
    Zend_Loader::loadClass('Zend_Debug');
    Zend_Loader::loadClass('Zend_View');
     
    Zend_Loader::loadClass('Membre');
    Zend_Loader::loadClass('Membres');
    Zend_Loader::loadClass('MembresEvenements');
    Zend_Loader::loadClass('Evenement');
    Zend_Loader::loadClass('Evenements');
    Zend_Loader::loadClass('Document');
    Zend_Loader::loadClass('Documents');
    Zend_Loader::loadClass('DocumentsEvenements');
    //Zend_Loader::loadClass('Groupe');
    ///Zend_Loader::loadClass('Groupes');
    //Zend_Loader::loadClass('MembresGroupes');
     
    $logger->log("Chargement de la configuration", Zend_Log::DEBUG);
    $config = new Zend_Config_Ini('../application/config/config.ini', 'dev_local');
    $logger->log("Initialisation de la BDD", Zend_Log::DEBUG);
    $db = Zend_Db::factory($config->database->adapter, $config->database->params->toArray());
    Zend_Db_Table_Abstract::setDefaultAdapter($db);
    Zend_Registry::set('db',$db);
     
    $front = Zend_Controller_Front::getInstance();
     
    // Set several module directories at once:
    $front->setControllerDirectory(array(
        'admin'		=> '../application/modules/admin/controllers',
        'default'	=> '../application/modules/site/controllers'
    ));
     
     
    $router = $front->getRouter(); // returns a rewrite router by default
    $router->addRoute('default', new Zend_Controller_Router_Route_Module(array('controller' => 'site', 'action' => 'index')) );
     
     
    //route pour le profil d'un membre. URL de la forme 'membre/' suivi du login du membre
    $route = new Zend_Controller_Router_Route( 'admin/:controller/:action/*', array('module' => 'admin'));
    $router->addRoute('admin', $route);
     
    //route dynamique pour les evenements
    $route = new Zend_Controller_Router_Route( 'evenement/:id', array('controller' => 'evenement', 'action' => 'detail'), array('id' => '\d+'));
    $router->addRoute('detailEvenement', $route);
     
    //route pour le profil d'un membre. URL de la forme 'membre/' suivi du login du membre
    //$route = new Zend_Controller_Router_Route( 'membre/:nom', array('controller' => 'membre', 'action' => 'profil'));
    //$router->addRoute('profilMembre', $route);
    $route = new Zend_Controller_Router_Route( 'membre/:id', array('controller' => 'membre', 'action' => 'profil'), array('id'=>'\d+'));
    $router->addRoute('profilMembre', $route);
     
    //route dynamique pour l'interface de gestion
    $route = new Zend_Controller_Router_Route('gestion/*', array('controller' => 'membre', 'action' => 'gestion'));
    $router->addRoute('gestion', $route);
     
    //route statique pour le formulaire de connexion
    $route = new Zend_Controller_Router_Route_Static('connexion', array('controller' => 'auth', 'action' => 'login'));
    $router->addRoute('connexion', $route);
     
    //route statique pour la deconnexion
    $route = new Zend_Controller_Router_Route_Static('deconnexion', array('controller' => 'auth', 'action' => 'logout'));
    $router->addRoute('deconnexion', $route);
     
    //route statique pour le formulaire d'enregistrement
    $route = new Zend_Controller_Router_Route_Static('inscription', array('controller' => 'auth', 'action' => 'register'));
    $router->addRoute('inscription', $route);
     
    //route statique pour le formulaire de contact
    $route = new Zend_Controller_Router_Route_Static('contact', array('controller' => 'site', 'action' => 'contact'));
    $router->addRoute('contact', $route);
     
    //route statique pour les credis
    $route = new Zend_Controller_Router_Route_Static('credits', array('controller' => 'site', 'action' => 'credits'));
    $router->addRoute('credits', $route);
     
    //route statique pour la page d'aide
    $route = new Zend_Controller_Router_Route_Static('aide', array('controller' => 'site', 'action' => 'help'));
    $router->addRoute('aide', $route);
     
    //route statique pour la page d'accueil
    $route = new Zend_Controller_Router_Route_Static('accueil', array('controller' => 'site', 'action' => 'index'));
    $router->addRoute('accueil', $route);
     
    //route statique pour la page legal
    $route = new Zend_Controller_Router_Route_Static('droit', array('controller' => 'site', 'action' => 'legals'));
    $router->addRoute('droit', $route);
     
    //route statique pour le formulaire de redaction
    //$router->addRoute('annonce/rediger', new Zend_Controller_Router_Route_Static( 'annonce/rediger', array('controller' => 'annonce', 'action' => 'new')) );
     
    $logger->log("Route cree", Zend_Log::DEBUG);
     
    define('ROOT_URL', 'http://XXXX/');
     
    $view = new Zend_View();
    $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
    $viewRenderer->setView($view)->setViewSuffix('tpl');
     
    $logger->log("Dispatching", Zend_Log::DEBUG);
     
    $front->dispatch();
    Merci d'avance de votre aide.

  2. #2
    Membre Expert
    Avatar de Eusebe
    Inscrit en
    Mars 2006
    Messages
    1 992
    Détails du profil
    Informations personnelles :
    Âge : 47

    Informations forums :
    Inscription : Mars 2006
    Messages : 1 992
    Par défaut
    Bonjour,

    Ne les ayant jamais utilisés, je ne maîtrise pas encore les modules du framework. Mais j'ai déjà eu des problèmes de remontées d'erreur. Pour tester, peux tu activer le lancement d'exception par le contrôleur frontal en ajoutant
    $front->throwExceptions(true); avant le dispatch ? Peut-être que l'erreur sera plus précise que celle renvoyée par le debug...

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    25
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mars 2006
    Messages : 25
    Par défaut
    Mon problème est résolut (réponse sur un autre forum

    Il fallait en fait mettre le nom du module (Admin) dans le nom de classe mais PAS ds le nom du fichier.

    @Eusebe : en fait "mon" debug est un version améliorée de la remontée d'erreur (un message général suivi de toute le stack trace). Je l'ai repris de la doc je crois.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Delphi 7 et 5] Problème de module Base de données
    Par riadmega dans le forum Débuter
    Réponses: 1
    Dernier message: 25/11/2007, 11h26
  2. [Eclipse3.3.0 CDT4.0.1] Problème mise en route
    Par arn0caba2le dans le forum Eclipse C & C++
    Réponses: 2
    Dernier message: 11/10/2007, 16h55
  3. problème de module menu jlomenu
    Par nemo666 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 11
    Dernier message: 23/04/2007, 22h51
  4. Problème du module login lors du changement de mot de passe
    Par MIC94 dans le forum Wildfly/JBoss
    Réponses: 1
    Dernier message: 31/08/2006, 11h51
  5. [Oracle9i]Problème création module d'écoute
    Par Gidrah dans le forum Oracle
    Réponses: 2
    Dernier message: 25/04/2006, 19h32

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