Yii State Machine extension

Hey, I added a state machine for Yii, it keeps track of different object states and encapsulates the logic that applies to that state as well as providing events that can be handled when the object transitions from one state to another, the code is available at github:

Also posted this as an extension: http://www.yiiframework.com/extension/yii-state-machine/

Great. :)

A good alternative to the simpleworkflow extension.

Cool I hadn’t seen that one, thanks for the link, it looks like that one depends on active record, whereas this can be used for any kind of component.


I noticed that on the Yii Framework Extension site the following heading is missing:

Adding the state machine to our user model

Also, it would be nice if you could add a UML state chart for the example you made - would help people to understand.