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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:03:28+00:00 2026-05-17T23:03:28+00:00

Guys I have the following structure in my project. application/ Bootstrap.php configs/ application.ini modules/

  • 0

Guys I have the following structure in my project.

application/
   Bootstrap.php
   configs/
      application.ini
   modules/
      default/
         controllers/
         models/
         views/
         Bootstrap.php
      main/
         controllers/
            UserController.php
         forms/
         models/
            resources/
            validate/
         views/
            scripts/
               user/
                  complete-registration.phtml
                  index.phtml
                  register.phtml   
         Bootstrap.php
      rest/
         controllers/
            LoginController.php
         models/
         views/
         Bootstrap.php

Now to the problem. I have defined few actions within the UserController.php which I cant seem to access. For e.g. if I go to localhost/main/user/register I cant access this. However I browse to localhost/main/user it works.

I have no idea what it could be but my wild guess is its something to do with my Bootstrap.php. While debugging I commented the rest route initialize in the main bootstrap.php and it seemed to work. I have given the all the files that I think are affected by this. If I can know what it could be it would be awesome. Already spent like few days trying to figure this out.

Bootstrap.php

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    // Commenting this seems to make the module auto initializing work.
    protected function _initRestRoute()
    {
        $this->_logger->info('Bootstrap ' . __METHOD__);
        $this->bootstrap ( 'frontController' );
        $frontController = Zend_Controller_Front::getInstance ();
        //$restRoute = new Zend_Rest_Route ( $frontController );
        //$frontController->getRouter ()->addRoute ( 'default', $restRoute );
        $restRoute = new Zend_Rest_Route($frontController, array(), array('rest'));
        $frontController->getRouter ()->addRoute('rest', $restRoute);
    }
}

Main/Bootstrap.php

<?php

class Main_Bootstrap extends Zend_Application_Module_Bootstrap
{

}

Main/controllers/UserController.php

<?php

class Main_UserController extends Zend_Controller_Action
{

    protected $_model;

    public function init()
    {
        // Get the default model
        $this->_model = new Main_Model_User ();
        // Add forms
        $this->view->registerForm = $this->getRegistrationForm ();
    }

    public function indexAction()
    {
    }

    public function registerAction()
    {
    }

    public function completeRegistrationAction()
    {
        $request = $this->getRequest ();
        if (! $request->isPost ())
        {
            return $this->_helper->redirector ( 'register' );
        }
        if (false === $this->_model->registerUser ( $request->getPost () ))
        {
            return $this->render ( 'register' );
        }
    }

    public function getRegistrationForm()
    {
        $urlHelper = $this->_helper->getHelper ( 'url' );
        $this->_forms ['register'] = $this->_model->getForm ( 'userRegister' );
        $this->_forms ['register']->setAction ( $urlHelper->url ( 
            array (
                'controller' => 'user', 
                'action' => 'complete-registration' 
            ), 
            'default' ) );
        $this->_forms ['register']->setMethod ( 'post' );
        return $this->_forms ['register'];
    }
}

application.ini

[production]
autoloadernamespaces[] = "Zend_"
autoloadernamespaces[] = "SB_"

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"

; front controller
resources.frontcontroller.moduledirectory = APPLICATION_PATH "/modules"

; modules
resources.modules[] =

resources.frontController.params.displayExceptions = 1

resources.db.adapter = "PDO_MYSQL"
resources.db.isdefaulttableadapter = true
resources.db.params.dbname = "****"
resources.db.params.username = "*****"
resources.db.params.password = "*******"
resources.db.params.host = "*******"
resources.db.params.charset = "UTF8"

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
  • 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-17T23:03:29+00:00Added an answer on May 17, 2026 at 11:03 pm

    Managed to get it to work by doing the following. Hope this will be useful for someone.

    Created a route within the front controller plugin.

    class SB_Controller_Plugin_Initialize extends Zend_Controller_Plugin_Abstract
    {
    
        public function routeStartup(Zend_Controller_Request_Abstract $request)
        {
            $frontController = Zend_Controller_Front::getInstance();
            $restRoute = new Zend_Rest_Route($frontController, array(), array('rest'));
            $router = $frontController->getRouter();
            $router->addRoute('rest', $restRoute);
        }
    }
    

    in application.ini,

    resources.frontController.plugins.Initialize = "SB_Controller_Plugin_Initialize"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.