Write a plugin based System

Can any one sugesst an example, reference, architecture on how to make a plugin based application with yii so that others can install the plugins and use the plugins functionality .

How to designe such systems.

I currently know how to make a simple MVC aplication with yii.

How to make a web based plugin interface so that user can install the plugin using browser and use it in yii application.

Have one done this type of work with yii.

Example like MOODLE