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

Clear separation for Controller and controllers required with Full Controller path #8

Closed
jigneshthummar opened this issue Mar 23, 2012 · 5 comments

Comments

@jigneshthummar
Copy link

-I can't find difference between folder Controller and controllers folder under Catalog ( and some other ) modules its possible to merge both of them or any reason why its like that?
-more over is it possible to add full controller path as controllers class name? same like Model and Block class name?
i.e
Mage_Catalog_IndexController can be converted to Mage_Catalog_controllers_IndexController

@colinmollenhour
Copy link

The classes under Controller are meant to be abstract classes which are extended by real controllers.

@jigneshthummar
Copy link
Author

any idea why Magento dont include controller folder name in controller class name ?
i agree we never need to make object of controller but when we rewrite controller we have to add controller file name which we rewriting. which we dont need when we rewrite block or model

@mzeis
Copy link
Contributor

mzeis commented Mar 25, 2012

Organising action controllers in a controllers/ directory and omitting "controllers" in the class name originates from Zend Framework.

@colinmollenhour
Copy link

When rewriting controllers sometimes you only want to rewrite specific methods. There are probably other good reasons as well, but in general controllers are quite a bit different than models/helpers/blocks.

@magento-team
Copy link
Contributor

Good question, @jigneshthummar.
You are not first, who asks about it.
@colinmollenhour and @mzeis are absoluttelly right.

when we rewrite controller we have to add controller file name which we rewriting. which we dont need when we rewrite block or model

If you say about rewritting controller via config.xml, than you don't need to specify file name there.
If you say about extending controller classes, than this is not recommended practice.

We'll add documentation page about differences between 'controllers' and 'Controller' directories in Magento Framework section.

maksek pushed a commit that referenced this issue Dec 26, 2014
[Github] Merge public Github commits
@alicedfisheye alicedfisheye mentioned this issue May 14, 2024
5 tasks
@FabXav FabXav mentioned this issue Oct 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants