Results 1 to 2 of 2

Thread: Omit parameter name in URL

  1. #1
    cheyo is offline Junior Member
    Join Date
    May 2008
    Posts
    5

    Default Omit parameter name in URL

    May i omit parameter name in URL in zend framework?

    for example, may i use
    http://127.0.0.1/user/delete/?23 or http://127.0.0.1/user/delete/23
    instead of
    http://127.0.0.1/user/delete/id/23 ?

    Of course, in the case, there is noly one parameter for this action.
    I would like to hide the parameter name in URL.

    Is that possible? thanks.

  2. #2
    cheyo is offline Junior Member
    Join Date
    May 2008
    Posts
    5

    Default

    i found the answer by myself. it should like the following:

    [PHP]
    /* added by cheyo 2008-06-06 above */
    $router = $frontController->getRouter(); // returns a rewrite router by default
    $route = new Zend_Controller_Router_Route_Regex(
    '([^/]+)/([^/]+)/(\d+)',
    null, /* this line could be: array('module' => 'default') */
    array(
    1 => 'controller',
    2 => 'action',
    3 => 'id'
    )
    );
    $router->addRoute('archive', $route);
    /* added by cheyo 2008-06-06 end */
    [/PHP]

Similar Threads

  1. Embedded parameter in Zend_Translate
    By thinknirmal in forum Internationalization (i18n) & Localization (l10n)
    Replies: 1
    Last Post: 07-14-2010, 11:24 PM
  2. Parameter Binding and SQL injection
    By adaykin in forum Databases
    Replies: 1
    Last Post: 05-11-2010, 11:29 PM
  3. Pagination With get parameter
    By Sami_ghname in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 03-02-2010, 12:43 PM
  4. getting 404 with dashed parameter
    By digit in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 11-20-2008, 06:05 PM
  5. Passing a URL in a parameter
    By icedcheese in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 10-17-2007, 06:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •