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

  • SEARCH
  • Home
  • 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 4074712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:12:20+00:00 2026-05-20T17:12:20+00:00

is there a way in Zend to call one controller from another? I have

  • 0

is there a way in Zend to call one controller from another?

I have seen the action stack but that does not seem to work for me and i have read that alot of people think it to be EVIL!

What i am trying to acchive is as follows:

Reports Controller scans through all the modules in the system, it then checks to see if a route has been registered for that module called MODULENAME-reports-run

The controller then reuns that registered route to generate all the reports from all the modules.

The idea is that i can create modules for my application that clients can simple drag and drop into place and the system picks up on the reports.

  • 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-05-20T17:12:21+00:00Added an answer on May 20, 2026 at 5:12 pm

    Your controller should not do any of these things. Your controller should only accept any input from the User Interface and then decide to delegate this to the appropriate classes in your Model.

    If you have a ReportController, have it accept any input and forward it to a ReportsService or something else in the Model responsible for generating Reports. It’s not the controllers responsibility to generate them.

    It should look something like this:

    public function generateReportAction()
    {
        try {
            $service = new Model_ReportService;
            $service->setReportToGenerate($this->getRequest()->getParam('reportId'));
            $this->view->report = $service->generateReport();
        } catch (ReportException $e) {
            // do something with $e
        }
    }
    

    If your ReportService needs to generate multiple reports, change the ReportService so it knows how to do that. You could do something like

    $service = new Model_ReportService;
    $service->setModulesDirectory('something');
    $this->view->reports = $service->generateReportsForModules();
    

    Personally I dont think a ReportService should need to know about a Module Directory, so you will want to give the public interface of that Service some more thought. But in general, this is the way to go.

    Whatever you do, dont do it in the controller. Controllers ought to be slim.

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

Sidebar

Related Questions

I'm using Zend framework, and most of the action controller that I have return
Is there a way to integrate Zend framework with Doctrine 2 but with an
Is there a way to call a MySQL stored function (not procedure) in Zend
is there way how to get name ov event from Lambda expression like with
I think that I am having a slow evening but I have a question
I just realized that there is no best way to hide MySQL string connection
What is the best way to access my models and forms from a controller
I have this code which calls a stored procedure within ZEND. Is there a
I call my site this way locally: http://localhost:80/mysite/de/layer1/layer2/module In .htaccess I have: RewriteEngine on
is there a way to do modules in cakephp like zend framework modules ?

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.