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 3339860
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:32:28+00:00 2026-05-18T00:32:28+00:00

I’m wondering of it’s possible to create a module structure in a module (or

  • 0

I’m wondering of it’s possible to create a module structure in a module (or something that appears like that)

Currently I use an admin module, using urls like this:

public/admin/index/index

with a folder structure like this:

applications
-- modules
---- admin
------ controllers
------ views [and so on]

I would like to use these kind of urls:

public/admin/news/index/index
public/admin/gallery/index/index

Where news and gallery are modules

The folder structure would look like this

applications
-- modules
---- admin
------ controllers
------ views
-------- scripts
---------- modules
------------ news
-------------- controllers
-------------- views [and so on]
------------ gallery
-------------- controllers
-------------- views [and so on]

Is this possible? I tried adding another module in my bootstrap:

$moduleLoader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Module',
            'basePath' => APPLICATION_PATH . '/modules/admin/views/scripts/modules'));

But that didn’t work out.
I could create news, gallery and such modules and load them in my admin layout. Everything would be in in the same style and menu as the rest of the admin but I would rather see it my way (if it’s possible)

If I want something completely out of the question or have any tips, ideas, please let me know.

  • 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-18T00:32:29+00:00Added an answer on May 18, 2026 at 12:32 am

    A Module is a collection of logical linked functionality (for example, a gallery). To keep things simple, you should store all related code for a module in it’s directory (this also includes any admin-tasks). In your adminModule you have the code of several other modules, which makes both modules hard to reuse as they all depend on the AdminModule and the AdminModule depends on all other modules. This totally breaks the idea of modules. If it helps to understand, you can see the controllers as submodules (it’s wrong I know, but maybe it makes understanding easier).

    So at first you could do something like this:

    • Gallery Module
      • ImageController (viewAction, browseAction,…)
      • AdminController (editImage, uploadImage, …)
      • …
    • User Module
      • SettingsController
      • AdminController
      • …

    But again you split the code for one entity over different Controllers. Like in the ImageController you handle the viewing of images but the editing and uploading is done in the AdminController.
    So (it least that’s how I do it):

    • Gallery Module
      • ImageController (viewAction, addAction, editAction, deleteAction, …)
      • GalleryContoller (viewAction, addAction, editAction, deleteAction, …)
      • ….

    This keeps all stuff together that logicaly belongs together. One controller is responsible for all actions for one entity (like the ImageController for all actions concerning one image, the GalleryController for actions concerning gallerys). This also includes administrative tasks.
    If you do it this way, there probably is no real AdminModule. It’d only be some kind of navigation linking to the administrative actions of each Module/Controller.

    You sure can rewrite the zf to support submodules. This would involve:

    • Adding a route that supports submodules (easy one)
    • Rewrite the Dispatcher to support submodules
    • Rewrite the Autoloader for submodules
    • Adding several other directories to Plugin-Loaders & others

    But this isn’t done with any mvc framework I’ve ever seen as this usually implies a design-weakness (again, in my oppinion) and a general performance loose (the more directories to look up for the autoloader the worse).

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

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.