Lazy loading View helpers

Along the same lines of the Dynamic model inclusion I posted awhile ago, this tidbit of code will let you lazy load helpers inside of your view. To use just create the file /app/views/auto_helper.php with the contents of the Github Gist below and then change your AppController's view variable to AutoHelper. public function beforeFilter() { $this->view = 'AutoHelper'; } If your application uses the ThemeView you can change the code to extend from that instead of View without a whole lot of trouble. Just be sure to import the ThemeView object by adding the following to the top of the file: App::import('View', 'Theme'); If you have any helpers that need to be available to catch the beforeRender callback or that require configuration, you should not let them be lazily loaded, keep them in the $helpers array in your controller. This hasn't been thoroughly tested so various quirks may arise, if so let me know. [gist id=588683]