'Invalid controller specified (error)'

For programming and general questions on Zend Framework
Post Reply
emile1986
Posts: 57
Joined: Wed Mar 31, 2010 10:08 am

'Invalid controller specified (error)'

Post by emile1986 » Tue Apr 06, 2010 1:42 pm

hello all,

I'm working on a modulair application based on ZF 1.10, the modules are stored in the application/modules folder.
The page itself displays as it should be, but when i try to submit the filled in bug form it generates the following error:

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in J:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 J:\xampp\php\PEAR\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 J:\xampp\php\PEAR\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch() #2 J:\websites\Admin-Panel\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #3 J:\websites\Admin-Panel\public\index.php(29): Zend_Application->run() #4 {main} thrown in J:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php on line 242


This is my bugController that is stored in the application/modules/default/controllers directory and the setAction parameter is set to /bug/submit

Code: Select all

<?php

class BugController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }
    
    public function listAction()
    {
    	// show the submitted bugs in a table	
    }

    public function submitAction()
    {
        // submit a new bug
        $bugform = new Form_BugReportForm();
        $bugform->setAction ('/bug/submit');
        $bugform->setMethod('post');
        if ($this->getRequest()->isPost()){
        	if($bugform->isValid($_POST)){
        		$bugModel = new Model_Bug();
        		// if the form is valid, then create the new bug
        		$result = $bugModel->createBug(
        			$bugform->getValue('name'),
        			$bugform->getValue('email'),
        			$bugform->getValue('date'),
        			$bugform->getValue('url'),
        			$bugform->getValue('description'),
        			$bugform->getValue('priority'),
        			$bugform->getValue('status')
        		);
        		// if the createBug method returns a result
        		// then the bug was successfully created
        		if ($result){
        			$this->_forward('confirm');
        		}
        	}
        }
        $this->view->bugform = $bugform;
    }
    
    public function confirmAction()
    {
    	
    }
    
}
any ideas what the problem can be?

Thanks in advance,

Emile Oosthoek

shakirkhan
Posts: 2
Joined: Fri May 28, 2010 7:48 am

Re: 'Invalid controller specified (error)'

Post by shakirkhan » Mon Aug 30, 2010 9:49 am

Hi Emile,

I have been facing the same problem and have tried couple of fixes after goggling but no success. If you have fixed that problem then kindly let me know.

emile1986
Posts: 57
Joined: Wed Mar 31, 2010 10:08 am

Re: 'Invalid controller specified (error)'

Post by emile1986 » Mon Aug 30, 2010 12:40 pm

you have to copy the error controller and the corresponding view file to the direct place in your module

shakirkhan
Posts: 2
Joined: Fri May 28, 2010 7:48 am

Re: 'Invalid controller specified (error)'

Post by shakirkhan » Tue Aug 31, 2010 5:07 am

Thanks for your reply emile,
I have copied the Error Controller and Corresponding view as it in modules controller and view folder as it is but still no success. Do i need to change something else like path to point module folder instead something else....
Also would you mind to paste your bootstrap file here

emile1986
Posts: 57
Joined: Wed Mar 31, 2010 10:08 am

Re: 'Invalid controller specified (error)'

Post by emile1986 » Mon Sep 06, 2010 9:19 am

maybe you have to modify your application.ini file and your application/Bootstrap.php file

i have added the following lines to my files

application.ini

Code: Select all

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
application/Bootstrap.php

Code: Select all

      //setup the frontController
		Zend_Loader_Autoloader::autoload(Zend_Controller_Front); 
		$frontController = Zend_Controller_Front::getInstance();
		
		// frontController Configuration
		$frontController->addModuleDirectory(APPLICATION_PATH . '/modules');
		$frontController->setDefaultModule('default');
      $frontController->setModuleControllerDirectoryName('controllers');
Hope this helps for you

Kind regards,

Emile

latamdatehox
Posts: 1
Joined: Thu May 10, 2018 9:40 am

LAtamDATE scam

Post by latamdatehox » Thu May 10, 2018 9:41 am

motor vehicle scoops

economy money activities chit chat movement tv sets Music theater martial arts styles Crosswords pictures horoscopes ordinary really Yearly connection daily life physical supper free games Viva most useful remarks on guidance vehicles buyer's assist stats LatamDate SCAM things snap shots museums and galleries Views blankets free classified sites Trending: ben Brokaw eva HUCKABEE SANDERS KANYE rest of the world cost COSBY robert Francesa

cozy from the squeeze the writer Leno tells motors; A 2019 Corolla hatchback take another look at in addition to tight guide: 2018 honda civic visiting image: $2.3 million Bugatti achieves costliest inflatible donuts do you Chevy's 2019 suv can be amount to do with usefulness complete with RST package

8 helpful personality with all the 2018 Audi A5 selection. as well as a terminal flaw First create: 2019 Genesis G70 study: Genesis store rollout is run through transition of a coverages vid: game master contains 3D personalised vehicles roles in creation graphics: dodge challenger SRT satanic force as contrasted with. opposition LatamDate SRT Hellcat toyota evokes an additional 26,000 flow trucks what it's like to push all of the 2018 latamdate mercedes LS to cali alcohol locale Nissan's ProPilot partial autonomous computer reported

picture search all art galleries Gallery perspective sugar: 2019 chevy suburban RST Gallery Gallery: 1980 vs,v,against. health care practice decorations Joe's Music since dancing academia Brooklyn/Queens Attias your oven consortium reputable escalator goods and services, Corp. non profit business organisation Lunar nyc perceive good deal wounded help Saeilo magnetic generators Garrett Car consider dividing Car long island east.

Post Reply