- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Folks,
Another concern is:
What is the Difference between controller and Blocks ?
Thanks
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Below is the main difference between controller and block !
Block are responsible for rendering content (everything from frontend, backend, emails, and more). If content is being displayed somewhere chances are it is a block.
controllers are responsible for processing all requests made via a url. If you hit the url http://www.example.com/catalog/product/view/id/9/ you hit the catalog module in the controllers/ProductController.php and inside of that the viewAction() method. If you hit a URL in Magento the request passes through one or more controllers.
For more details refer below links :
https://stackoverflow.com/questions/14283920/magento-model-vs-block-vs-controller-etc
Hope it helps !
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: What is the Difference between controller and Blocks
Please cehck following thread:
https://stackoverflow.com/questions/14283920/magento-model-vs-block-vs-controller-etc
Meet 70+ extensions and templates for M1 & M2 in one place
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Below is the main difference between controller and block !
Block are responsible for rendering content (everything from frontend, backend, emails, and more). If content is being displayed somewhere chances are it is a block.
controllers are responsible for processing all requests made via a url. If you hit the url http://www.example.com/catalog/product/view/id/9/ you hit the catalog module in the controllers/ProductController.php and inside of that the viewAction() method. If you hit a URL in Magento the request passes through one or more controllers.
For more details refer below links :
https://stackoverflow.com/questions/14283920/magento-model-vs-block-vs-controller-etc
Hope it helps !