[eluser]Rick Jolly[/eluser]
[quote author="essexgirl" date="1199993050"]
Quote:Could be something as simple as a redirect in the constructors of parent controllers. The parent controllers could have checks against values in config.php
I am not sure I understand what you meant by this Rick. Assuming I have not misunderstood you, I was trying to avoid having anything at all in the controllers for the app's forms. The hook is specifically to avoid having to repeat stuff in every constructor . . .[/quote]
Extending the CI Controller is one way of avoiding code repetition. What you did with the hook could also be done in one place using inheritance. You'd just extend the CI Controller, and put some code in the constructor of that new parent controller (the code would be a redirect to a static page if the site was "closed"). Then instead of all controllers extending the CI controller, they'd extend the new parent controller.
You can go wild with inheritance. You could have a custom parent controller and then have an admin and public parent controller extend it. That is what I was getting at with the example.
I don't like hooks for anything application specific because hooks aren't transparent/traceable.