controllers/ItemController.php
public function actionTriggerEvents()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $result = ($post = Yii::$app->request->post('depdrop_parents'))
            ? Item::eventList($post[0])
            : [];
        $output = [];
        foreach ($result as $id => $name) {
            $output[] = compact('id', 'name');
        }
        echo Json::encode(['output' => $output, 'selected' => '']);
    }
public function actionTriggerEvents()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $result = ($post = Yii::$app->request->post('depdrop_parents'))
            ? Item::eventList($post[0])
            : [];
        $output = [];
        foreach ($result as $id => $name) {
            $output[] = compact('id', 'name');
        }
        echo Json::encode(['output' => $output, 'selected' => '']);
    }
public function actionTriggerEvents ( ) { Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; $ result = ( $ post = Yii :: $ app -> request -> post ( 'depdrop_parents' ) ) ? Item :: eventList ( $ post [ 0 ] ) : [ ] ; $ output = [ ] ; foreach ( $ result as $ id => $ name ) { $ output [ ] = compact ( 'id' , 'name' ) ; } echo Json :: encode ( [ 'output' => $ output , 'selected' => '' ] ) ; }
Returns json event list for form DepDrop widget.
Returns json event list for form DepDrop widget .