Perhaps a wish-list for future documentation enhancements would be to add some use cases or case study type examples when there are multiple ways of doing similar tasks.....
I'm curious about when I should use routing or pre-dispatch for altering a request. Both can in effect accomplish re-routing, and I'm not real familiar with the pros and cons of either. In pre-dispatch, I can create a custom plugin that looks at the request and then changes the request object module/controller/action as a result.
In some common code examples, I see ACLs implemented at the pre-dispatch level, and often the result of an ACL is to change the request to the login controller (or something similar). But if I have a need for dynamic routing based on criteria that is determined from info in the database, that is also user dependent, I'm a little unsure on what the pro/con of using routing rules vs pre-dispatch. In either case, I would have to look at a particular DB table, cull some info out of it, and then build rules based on that. So does a pre-dispatch plugin have any advantages over routing? As far as I can tell, either way, I'm implementing some logic that results in the request object being altered either directly or indirectly. Thoughts?
Seth Atkins
没有评论:
发表评论