What I want is a design similar to Gii - the user is prompted to login before being able to access the rest of the site. There will be also a ‘Create account’ link under the user name/password fields.
Now what my problem is: if I have a default controller (e.g. SiteController), should I use filters? Or override the beforeControllerAction method (that’s what Gii does)? Or should I have another controller just to handle the login view/form? Most of the examples I saw, have an index page with a Login/Logout menu entry - not what I’m looking for.
After that, you can create a “parent” controller (for example MyController.php in ‘components’ direcotry) and then make other controllers extend MyController. In MyController, at last, you could use a filter to protect entire site access.
Thanks for your reply. I will look at the extensions, but as this is a uni project, I can’t rely heavily on not self-made code…
Anyway, there is the class Controller, which came in the extensions components directory (when my webapp was created with yiic). All other controllers inherit from this class. Would it be a good place to put the filter there?