0

I'm developing a component for Joomla 3.x and I'm having a problem with JControllerLegacy getModel. When I try to call it from within my controller.php in the dispaly function of the class CasehandlerController it breaks execution with no erorrs, just a blank page, as if the function was undefined. The very same code works fine on my local developement server but on the production server it fails when making this call. The function is as below:

    function display($cachable = false, $urlparams = false) 
    {
        $this->configuration = getConfiguration();
        // set default view if not set
        $input = JFactory::getApplication()->input;
        $input->set('view', $input->getCmd('view', 'Casehandler'));
        $view = $this->getView( $input->get('view'), 'html' );
        echo 'model:';
        $model = $this->getModel('Casehandler');// closing single quote missing here

        echo 'model done.';
        $view->setModel($model, true );
        $view->setLayout( 'default' );
        $view->display();
    }

"model:" gets echoed and "model done." does not. I've tried to debug this by echoing lines from inside the model class but with no response from that either. Calling getModel() without arguments also produces the same result. What could be the problem here when the exact same code runs fine on my local server?

Hirdesh Vishwdewa
  • 2,334
  • 1
  • 19
  • 33
FroboZ
  • 437
  • 1
  • 6
  • 17

1 Answers1

0

Having debugged this further by echoing lines from the JControllerLegacy class inside the getModel function I got a hint from the $prefix variable displaying the model name as casehandlerModel instead of CasehandlerModel, changed the filename of the model from casehandler.php to Casehandler.php and that fixed the problem...

FroboZ
  • 437
  • 1
  • 6
  • 17