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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:08:03+00:00 2026-05-25T17:08:03+00:00

I had to develop a CMS using Zend Framework and I used the default

  • 0

I had to develop a CMS using Zend Framework and I used the default namespace defined in my boostrap for my backend:

autoloaderNamespaces[] = "Application_"

Now I want to develop the frontend, but I don’t know how to do it, since I have access to my backend from the /public/ directory.

Then I would like to use a different layout for my frontend than the one I use for the backend access. So I found this post but I don’t know if I have to change/add (and then how to change) the module of my backend, or if I have to create a second module that I will use for my frontend

my file tree is like this :

tree

So if I create a frontend module, shall I create a frontend directory next to the applicationdirectory ?

EDIT : I created 2directories pub and frontend next to the application directory. In pub/index.php I instanciated the bootstrap with the application/configs/application.ini file with a different APPLICATION_FRONT_ENV :

[frontprod : production]

bootstrap.path = APPLICATION_FRONT_PATH "/bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_FRONT_PATH "/controllers"
autoloaderNamespaces[] = "Frontend_"
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_FRONT_PATH "/layouts/scripts"

[frontdev: frontprod]

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

and in the frontend/bootstrap.php I loaded models from applicationdirectory :

public function _initAutoloader(){

        $baseAutoload = new Zend_Loader_Autoloader_Resource(array(
                                    'namespace' => 'Application',
                                    'basePath' => realpath(dirname(__FILE__).'/../application')
                                )
                            );

}

And it seems to be working fine =)
thank you !

  • 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-25T17:08:04+00:00Added an answer on May 25, 2026 at 5:08 pm

    In Zend Framework you can organise your app in modules, wich suits very well to your needs. Unfortunately the doc doesn’t emphasize enough the importance of this concept, and how you should implement it from day one.

    Modules allows you to regroup under a same module folder everything that is related to this module only, and this way to isolate “parts” of your app in logical groups.
    In your case it would be “back” and “front”, but you could also have a “forum” module or let’s say a “shop” module.

    In the urls point of view, the default routing of a modular structure is example.com/module/controller/action, but using hostname routes you can also have http://www.example.com pointing to your “front” module and admin.example.com pointing to your backend.

    Have a look at the poor documentation section about modules, and don’t panic, you won’t have to rename everything if you move your current controllers, views and models in the “default” module.

    There is an other alternative that could suit well for a backend/frontend logic, but not if you want to split your code in more logical parts (forum, blog, shop,…). You just create a second application folder (you would name ‘frontend’) next to the ‘application’ folder, and a second public directory (where you can symlink your assets folder if you use the sames), and a different namespace.

    To be able to autoload your ‘Application_’ classes in your frontend code, just add and configure a Module Autoloader in your frontend bootstrap. The code is quite simple :

    //in your frontend/Bootstrap.php
    public function _initAutoloader(){
         new Zend_Loader_Autoloader_Resource( array(
                 'namespace' => 'Application_',
                 'path' => realpath(dirname(__FILE__).'/../application'
             )
         );
    }
    

    For the application.ini config file i would recommend, instead of duplicating it, that you create a section [frontprod : production] section where you override your backend settings (and a matching [frontdev: frontprod] for your local settings).

    I hope this helped. There is so much to say about all the topics introduced here that you should first have a look at this, then comment this answer with more specific questions about the problems you may encounter, and i’ll extend the answer.

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

Sidebar

Related Questions

I want to develop some web apps using Google app engine. I had deployed
I have a (custom) embedded jetty launcher which I had been using to develop/test
When I used to develop in C++, I remember that Visual Studio had an
In my company we develop a software product. Until now we haven't had any
Recently I had to develop a SharePoint workflow, and I found the experience quite
Say if you had to develop a huge windows desktop app what language/technology you
I had used Server Explorer and related tools for graphical database development with Microsoft
I had a jqGrid displaying perfectly ok. Then I started to develop a basic
Possible Duplicate: iPhone app without AppStore My boss had an idea to develop an
I had to develop some custom ASP.NET web controls because I couldn't find ones

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.