Zend Forms Module Include Paths

后端 未结 3 1534
暗喜
暗喜 2021-01-07 06:35

I\'m using Zend 1.8.4 and setting up a simple form test. My form class is located in \'./application/forms/SectorSearch.php\' and the class name is



        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-07 07:13

    I added the following to my Bootstrap.php file

    protected function _initAutoload()
        {
            $autoloader = new Zend_Loader_Autoloader_Resource(array(
                'namespace' => '',
                'basePath' => APPLICATION_PATH,
                'resourceTypes' => array(
                    'form' => array(
                        'path' => 'forms',
                        'namespace' => 'Form',
                    ),
                    'model' => array(
                        'path' => 'models',
                        'namespace' => 'Model',
                    ),
                )
            ));
            return $autoloader;
        }
    

    and now it works, no errors anymore.. damn i'm glad it works, i was almost going mad.. :)

提交回复
热议问题