#6256: need of an 'beforDispatch' controller callback function
-------------------------------+--------------------------------------------
Reporter: robustsolution | Owner:
Type: Enhancement | Status: closed
Priority: Medium | Milestone: 1.2.x.x
Component: Controller | Version: 1.2 Final
Severity: Normal | Resolution: wontfix
Keywords: | Php_version: n/a
Cake_version: 1.2.2.8120 |
-------------------------------+--------------------------------------------
Changes (by mark_story):
* status: reopened => closed
* resolution: => wontfix
Comment:
Again, I think moving some of your logic to you component initialize() may
help. Currently you are describing a process that goes like:
* controller is constructed
* Components are constructed.
* Controller initializes components. (initialize())
* Controller configures components and runs general pre-action logic.
(beforefilter())
* Component configures controller (startup())
* **Controllers see what just happened, and reconfigure/process
additional logic (new)**
* controller action runs.
* controller beforeRender()
* component beforeRender()
* render()
* component shutdown()
* controller afterFilter()
That is a lot of chatter going on between controllers and components, and
having them respond to each other configuring one another. You could
achieve the same effect without the additional callback, by adding the
ability for your components to trigger methods on your controllers during
the startup(). Since there are numerous opportunities to create moar
callback, I don't see a reason how adding even more callbacks improves
things. Furthermore, it begets the question, of why only beforeDispatch,
shouldn't there be a co-responding afterDispatch, and then we should
probably have an afterAfterFilter.
[[BR]][[BR]]
The heart of issue is that adding more callbacks without solid use cases
doesn't really improve things. Personally I think there are more than
enough callbacks, and I would err on the side of removing callbacks before
adding any new ones.
--
Ticket URL: <https://trac.cakephp.org/ticket/6256#comment:3>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---