Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaf_Loader could not find controller. #1

Open
akDeveloper opened this issue Jul 15, 2012 · 2 comments
Open

Yaf_Loader could not find controller. #1

akDeveloper opened this issue Jul 15, 2012 · 2 comments
Labels

Comments

@akDeveloper
Copy link
Owner

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.

@FightingMan
Copy link
Contributor

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

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

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

@akDeveloper
Copy link
Owner Author

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants