Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Action Into Widget

$
0
0
Hi

I want some action in custom widget

I found this wiki about that
http://www.yiiframework.com/wiki/146/how-to-use-a-widget-as-an-action-provider/

But I want the actions function into widget not as an CAction class

I want it As be done in controller.

In the wiki the actions are declared in static function

class myWidget extends CWidget {
...
 public static function actions(){
        return array(
           'GetData'=>'application.components.actions.getData',
        );
    }
...
}
//we have to make another one file with this code
class getData extends CAction{
    public function run(){
        echo 'HELLO WORLD';
    }
}


How can the same thing but like that
class myWidget extends CWidget {
...
public function actionGetData() {

}
...
}


I tried that but does not work!

Viewing all articles
Browse latest Browse all 18717

Trending Articles