Overview

Introducing Worklets

UniProgy Framework Worklets is the main component of our applications. It is a kind of a combination of Yii's Action, Widget and Component.

Worklets always belong to some module. They can be dynamically extended by the use of worklet filters and worklet behaviors.

Worklets as Actions

Similar to how Yii framework creates and runs an action according to the route when you create a worklet you can expect it to receive calls. For example if you create a worklet in /protected/modules/base/worklets/WBaseTest.php and that worklet is of a "widget" type (discussed later) - it can be accessed using following URL: http://yourdomain.com/base/test

In our case framework creates controller -> controller creates an action (usually default one) -> action calls initial worklet (kind of a controller for worklets) -> target worklet is created and executed.

Worklets as Widgets

Works almost the same way as Yii's native widgets but with full power of worklets. It can be easily called anywhere to print something out quickly.

app()->controller->worklet('base.test');

Click here for more info.

Worklets as Components

You can also create a "system worklet" which usually acts as a helper class.

System and Widget Worklets

In the current version of our framework worklets can be of only 2 types: system and widget. System worklet (must extend USystemWorklet) is a worklet that is not supposed to produce any output. Most of the times you will use it for helper purposes. Widget worklet (must extend UWidgetWorklet) is otherwise - it is supposed to print something out.

UniProgy framework includes a wide range of preset worklets. They are explained in separate articles - use the menu in the right. This is the biggest power of worklets - you can always extend it without touching the original code.