On Fri, 19 Jan 2007, Mark Elrod wrote: > It seems silly to restrict the use of m->call_next to the autohandler > itself. Allowing it to be called via a component (which works for > everything right now except for passing the args) provides a lot of > flexibility in organizing your site. I would hope that args passing > would be fixed rather than removing functionality that is already there.
There's two things to think about here. First, is it legit to use call_next() in a component that is not part of the wrapping chain? Personally, I don't really think so, but as John W pointed out, the tests disagree. Second, if call_next() can be used outside of the wrapping chain, what is its expected behavior in terms of argument passing. Right now, what it does is simply pass along the argument which the callee received. This works as documented when you only use call_next() inside the wrapping chain, since the first component in the chain gets the request args, and then each use of call_next() passes those along. The docs aren't that helpful here, they say: Calls the next component in the content wrapping chain; usually called from an autohandler. With no arguments, the original arguments are passed to the component. I'm not really sure what "original arguments" means. It could be interpreted as meaning $m->request_args(), but that's not what the code passes. Instead it basically passes along $m->caller_args(0). I think the current behavior makes sense, and the docs should be tweaked to be clearer. Changing it to request_args() is sort of appealing, but would break backwards compatibility big time, so that's out. The change you want would also break backwards compatibility, which is strike one. Strike two is that it's hard to document and harder to understand, since it's much more action-at-a-distance-y than the current behavior. -dave /*=================================================== VegGuide.Org www.BookIRead.com Your guide to all that's veg. My book blog ===================================================*/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users