yaf_base_application icon indicating copy to clipboard operation
yaf_base_application copied to clipboard

Yaf_Loader could not find controller.

Open akDeveloper opened this issue 12 years ago • 2 comments

PostController throws exception when try to navigate to uri /admin/posts/index

Could not find class PostsController in controller script ../modules/Admin/controllers/Posts.php

PostsControlleris in Admin module and extends AdminController from Admin module too. AdminController extends ApplicationController from default module.

Maybe too many extends causes this issue?

if PostController extends ApplicationController then everything works fine.

akDeveloper avatar Jul 15 '12 22:07 akDeveloper

/project/app/modules/Admin/controllers/Admin.php

class AdminController extends ApplicationController { public function init() { parent::init(); } }

/project/app/modules/Admin/controllers/Login.php

FightingMan avatar Jan 12 '13 11:01 FightingMan

Yes this is how i solve it too. But i think the right way is to be fixed by Yaf loader.

Also add this after parent::init() so controllers that extend AdminController can load views from Admin module.

// Set View path for module.
$path = $this->getConfig()->application->directory . "/modules/Admin/views";
$this->getView()->setScriptPath($path);

akDeveloper avatar Jan 12 '13 12:01 akDeveloper