extensionloader Create a plugable extension system, pretty much like wordpress plugins system

  1. Requirements
  2. Install
  3. Defined events
  4. Notes
  5. Disclaimer

After you install this extension, you will be able to create "installable" extensions, from where you can hook into the Yii controllers.
Because this extension will hook into Yii's defined application events, you can pretty much do everything(yes, you can even create controllers from your extensions/etc).

Requirements

Tested on Yii 1.1.10 and php 5.2.6

Install

1) Extract the archive and copy the contents of the protected folder over your application protected folder.
2) Change config/main.php like:

// preload the component  
'preload'=>array('log', 'extensionLoader'),  
  
// define it
'components'=>array(  
        'extensionLoader'=>array(  
            'class' => 'ExtensionLoader',  
        ),  
),  

Defined events

This extension defines the following events:

  1. onBeforeInit (called in CController::init() )
  2. onAfterInit (called in CController::init() )
  3. onBeforeAction (called in CController::beforeAction() )
  4. onAfterAction (called in CController::afterAction() )
  5. onBeforeRender (called in CController::beforeRender() )
  6. onAfterRender (called in CController::afterRender() )
  7. onBeforeProcessOutput (called in CController::beforeProcessOutput () )
  8. onAfterProcessOutput (called in CController::afterProcessOutput () )

There is also a ControllerBehavior which implements these events and their event handlers, so you can create new behaviors extending ControllerBehavior and hook into existing events.

Notes

In the archive, you will find an "example-extension" which implements some of the features this extension can provide.
Please study that extension several times before asking questions that could be answered by reading the source code.
For better understanding, i recommend installing the extension on a clean application, then move it to your real application.

Disclaimer

This extension is created for my needs, but i adjusted it a bit so that i can share it with everybody. Also, i haven't had too much time to improve things (there is room for better as always) but this is a working version and any feedback is appreciated.

2 0
11 followers
1 158 downloads
Yii Version: 1.1
License: (not set)
Category: Others
Developed by: twisted1919
Created on: Jul 26, 2012
Last updated: 11 years ago

Downloads

show all

Related Extensions