I am building a new CMS in Zend Framework and I don't have much exposure to ZF. Client requires two sections called Admin and FE. So, I have structured my application structure as follows.
- SITE -- application ---- configs ---- layouts ---- modules -------- default ------------ controllers ------------ forms ------------ models ------------ views ------------ Bootstrap.php -------- admin ------------ controllers ------------ forms ------------ models ------------ views ------------ Bootstrap.php ---- Bootstrap.php -- public -- library -- index.php
My structure is working fine and layouts and controllers are loading when I am accessing site like http://site or http://site/admin.
My question is 1.) How will I autoload my models in modules. In the model specific bootstrap file I have added below code. But it is not working.
class Admin_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected function _initAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'basePath' => APPLICATION_PATH.'/modules/admin/',
'namespace' => '',
'resourceTypes' => array(
'form' => array(
'path' => 'forms/',
'namespace' => 'Form_',
),
'model' => array(
'path' => 'models/',
'namespace' => 'CPModel_'
)
),
));
return $autoloader;
}
}
2.) How will I use different layouts for different module?