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

Zend PHP Discussion :

Routing Info (Création d'URL personnalisées)


Sujet :

Zend PHP

  1. #1
    Futur Membre du Club
    Inscrit en
    Juin 2004
    Messages
    7
    Détails du profil
    Informations forums :
    Inscription : Juin 2004
    Messages : 7
    Points : 6
    Points
    6
    Par défaut Routing Info (Création d'URL personnalisées)
    Mon fichier index.php de bootstraps

    //*********************************************************************************//
    <?php

    error_reporting(E_ALL|E_STRICT);
    ini_set('display_errors', 1);
    date_default_timezone_set('Europe/London');

    // Define path to application directory
    defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

    // Define application environment
    defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

    // Ensure library/ is on include_path
    /** set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
    )));*/

    /** Zend_Application */
    require_once "Zend/Loader.php";
    Zend_Loader::registerAutoload();

    require_once 'Zend/Application.php';

    // Create application, bootstrap, and run
    $application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
    );



    /** Routing Info **/

    $FrontController = Zend_Controller_Front::getInstance();
    $frontController->throwExceptions(true);
    $frontController->setControllerDirectory('../application/controllers');
    $Router = $FrontController->getRouter();
    $Router->addRoute("artiststore",
    new Zend_Controller_Router_Route
    (
    "artist/store",
    array
    ("controller" => "artist",
    "action" => "artistaffiliatecontent")
    ));

    $application->bootstrap()->run();

    //******************************************************************//
    La route pour mon URL est http://localhost/artist/artistaffiliatecontent je veux la changer pour
    http://localhost/artist/store j'ai ajouté les lignes dans index.php
    $FrontController = Zend_Controller_Front::getInstance();
    $frontController->throwExceptions(true);
    $frontController->setControllerDirectory('../application/controllers');
    $Router = $FrontController->getRouter();
    $Router->addRoute("artiststore",
    new Zend_Controller_Router_Route
    (
    "artist/store",
    array
    ("controller" => "artist",
    "action" => "artistaffiliatecontent")
    ));

    mais il me sort se message d'erreur

    An error occurred
    Page not found
    Exception information:
    Message: Action "store" does not exist and was not trapped in __call()

    Stack trace:
    #0 C:\ZF-1.8\library\Zend\Controller\Action.php(514): Zend_Controller_Action->__call('storeAction', Array)
    #1 C:\ZF-1.8\library\Zend\Controller\Dispatcher\Standard.php(288): Zend_Controller_Action->dispatch('storeAction')
    #2 C:\ZF-1.8\library\Zend\Controller\Front.php(936): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #3 C:\ZF-1.8\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
    #4 C:\ZF-1.8\library\Zend\Application.php(303): Zend_Application_Bootstrap_Bootstrap->run()
    #5 C:\wamp\www\loudbite\public\index.php(26): Zend_Application->run()
    #6 {main}
    Request Parameters:
    array(3) {
    ["controller"]=>
    string(6) "artist"
    ["action"]=>
    string(5) "store"
    ["module"]=>
    string(7) "default"
    }

    S.V.P J’ai besoin de votre aide

  2. #2
    Membre chevronné Avatar de nosferapti
    Profil pro
    Inscrit en
    Avril 2009
    Messages
    1 157
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2009
    Messages : 1 157
    Points : 1 895
    Points
    1 895
    Par défaut
    je crois que tu as oublié un slash là :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $Router->addRoute("artiststore",
    il faut mettre "artist/store"
    GNAP !

Discussions similaires

  1. [SP-2007] problême à création d'une applicaiton web avec URL personnalisée
    Par regh12 dans le forum SharePoint
    Réponses: 7
    Dernier message: 20/08/2009, 16h35
  2. [Sécurité] Chiffrement des infos dans l'URL
    Par Dsphinx dans le forum Langage
    Réponses: 14
    Dernier message: 04/01/2007, 16h57
  3. [Info]Création d'un Pool de thread
    Par yanis97 dans le forum Concurrence et multi-thread
    Réponses: 2
    Dernier message: 06/03/2006, 19h23
  4. [Info]Création d'un projet sous eclipse
    Par new_wave dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 08/01/2006, 23h06
  5. [Info]Création de packages
    Par mr.t dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 23/03/2005, 18h26

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