Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9068715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:15:25+00:00 2026-06-16T17:15:25+00:00

I am using Zend Framework 1.12. I wanted to add some routers. There are

  • 0

I am using Zend Framework 1.12.

I wanted to add some routers. There are users and administrators in my system, and I have added a router for administrator viewing user’s page.

I added

// meant to create the usage "xxx.com/userview/someusername"
    $route = new Zend_Controller_Router_Route(
            'userview/:username',
            array('controller' => 'user',
                'action' => 'viewone',
                'username' => 'someusernamedefault')
            );
    $router = $frontController->getRouter();
    $router->addRoute('userview', $route);

to my Bootstrap.php file.
I had some links in my sidebar, which contains links to actions (of another controller). I had added their link in a .phtml file as

echo $this->url(array('controller'=>'somecontroller', 'action'=>'someaction' ), null, true);

This sidebar contains lots of this links, which are from multiple controllers.

These worked fine till I added the route. After I added new route to Bootstrap (and added new action (viewall) to that controller (user) which is pointed from rooter, that works fine (I can use as “xxx.com/userview/someusername ). But my other links in the sidebar all becomes “xxx.com/userview”. They all lose their values of controller and action…

What am I doing wrong?? Should I define my url’s better, or my router better?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:15:27+00:00Added an answer on June 16, 2026 at 5:15 pm

    The second param to the URL helper should be the name of the route you want to use. By passing null you’re telling it to use the current route, which is why the links are coming out wrong. Change your sidebar link calls to:

    $this->url(array('controller'=>'somecontroller', 'action'=>'someaction'), 'default');
    

    and then it should work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I set up a Zend Framework application using Zend_Tool, but I wanted multiple modules
I have a PHP MVC application using Zend Framework. As presented in the quickstart,
I'm trying to develop a site using Zend Framework, but i have a problem:
In my application (using Zend Framework), I have a layout file ( layout.phtml )
I am using Zend Framework and Zend_Translate, Array adapter. Let's say I have the
I'm using Zend framework, and most of the action controller that I have return
I am using Zend Framework, I have a layout.phtml which renders navigation.phtml. How can
Using Zend Framework, is there a way to pass multiple conditions to an update
I'm using Zend Framework 1.8. I have a problem with headMeta() duplicating my meta
I'm using Zend Framework 1.8/1.9's Zend_Application and the resource system to initilize a bunch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.