Hi,
I’m new to Yii having previously had experience in using CakePHP and deciding to make the jump across. Still getting my head around a few things so some help would be greatly appreciated.
I currently have some code working as a prefilter, attached to a base controller that all my other controllers extend. It checks the domain and first few parts of the URL against the database for information (like organisation and site). I thought a prefilter would be a good approach but I’m not entirely sure.
Ideally I’m looking for:
- Code runs before any controller executes
- Sets data (org and site) that is needed for any subsequent code (e.g. Page controller / model would limit results to that org + site).
- Correctly throws 404’s when it doesn’t find matches.
Just can’t see how I should be passing the data around to the rest of the app and want to check if a prefilter is the ideal way.
Thanks,
Dave