Some system events

Hi,

I’ve been developing with Zend, Kohana and CI, for a while.

I’m a newbie to Yii, and I only have some notions of its architecture, so I’m exposing this just for your consideration:

One thing I think could be adopted from Kohana and ZF are some Application Plugins (as Plugins in ZF, or System Events).

enabling the use of Yii "Filters" applied in the whole application scope (Alternate RBAC extension is a good target, like ZF ACL plugin does)

It should be trivial to trigger some Events in some points of CWebApplication, handled by preloaded components. The slowdown resulting is up to the coder that wants to use this kind of Events versus Yii filters.

Lately I’ve been using Drupal, finding that not fulfills what I expected (sometimes I spent too much configuring it, trying to achieve some things that I could be coded in less time, and it’s performance is awful), so I’m returning to frameworks, but the PlugNPlay aspect of Drupal is a good thing, and could be achieved with some hooks in Yii.

What do you think?

What additional events would you add?

Well, preRoute and postRoute to alter urlManager resolutions, and preController and postController, to mimic application-scope filters. preDisplay and preShutDown for headers and logging, sessions, etc… Some people are very creative with a couple of hooks :P

Some could be achieved inhering your controllers from a child of CController, which has Filters applied on it.

But this kind of trick is a good example I think could be coded clearly with some of this events.

Sounds reasonable. Maybe you should create a ticket for it.

Welcome to the forums!