Validating Master Parameters

Hello, folks

Almost every request the user makes includes what I am calling Master Parameters. This is a $_GET parameter that selects a single record. Often it will just be the ‘id’ parameter in something like:

    [color="#A0522D"]r=post/view&id=27[/color]


Here, 'id' selects for a single master Post.   But there could be more than one master, like here:





    [color="#A0522D"]r=employee/create&company=30[/color][color="#A0522D"]&department=25[/color][color="#A0522D"]&mode=quick[/color]


Here, two master parameters tell us the Company and Department to add the Employee into.  Another parameter, 'mode' is not a Master Parameter, because it does not select for a particular record.

It would be nice if, before an action started, all master parameters were checked to exist, be consistent with each other, and perhaps loaded up and access checked. Then the action could focus on using the data rather than validating it. It sounds a lot like how form validating is centralized in CModel.rules() or how access is controlled in CController.accessRules(). Any thoughts on what direction to take this for a centralized, clear solution?

Thanks,

Greg