News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Leonid Mamchenkov's Blog:
Disable and enable CakePHP plugins on the fly
April 25, 2011 @ 11:45:17

Leonid Mamchenkov has a quick post to his blog showing how to enable and disable (well, restrict from enabling) CakePHP plugins on the fly - no need to modify config files if you only need it for a certain request.

I am currently working on a rather large project which is based on CakePHP framework. In order to simplify the task, I've broken down the whole application into a number of CakePHP plugins. Now, however, I want to enable/disable plugins on the fly. After a brief search around I couldn't find how to do that. Asking a question at #cakephp IRC channel did it. RabidFire instantly replied with the link that gave me an idea. 30 seconds later I had a working solution.

Since the plugins extend the main AppController, all it took was a beforeFilter() method call that looks at a request parameter for the plugin name, checks against an "allowed" array and throws an exception of it's not found or can't load it.

0 comments voice your opinion now!
cakephp plugin enable load plugin dynamic beforefilter tutorial


blog comments powered by Disqus

Similar Posts

Leonid Mamchenkov's Blog: Disable and enable CakePHP plugins on the fly

Laravel News: 75 Laravel Tutorials, Packages, and Resources from 2014

VG Tech: Swagger Docs in ZF2 with Examples - Part 1: Setup and Annotations

Slashdot.org: Book Review: PHP Hacks

Evolt.org: Quick Calendar Using AJAX and PHP


Community Events

Don't see your event here?
Let us know!


application voicesoftheelephpant library release symfony2 framework performance introduction community series example podcast interview part2 api php7 conference opinion configure laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework