controllers/CategoriesController.php
public function actionJsoncategories()
    {
        header('Content-type: application/json');
        $out = [];
        if(isset($_POST['depdrop_parents']))
        {
            $parents = $_POST['depdrop_parents'];
            if($parents != null)
            {
                $mod_table = $parents[0];
                $out = Categories::jsCategories($mod_table);
                echo Json::encode(['output'=>$out,'selected'=>'']);
                return;
            }
        }
        echo Json::encode(['output'=>'','selected'=>'']);
        exit;
    }
public function actionJsoncategories()
    {
        header('Content-type: application/json');
        $out = [];
        if(isset($_POST['depdrop_parents']))
        {
            $parents = $_POST['depdrop_parents'];
            if($parents != null)
            {
                $mod_table = $parents[0];
                $out = Categories::jsCategories($mod_table);
                echo Json::encode(['output'=>$out,'selected'=>'']);
                return;
            }
        }
        echo Json::encode(['output'=>'','selected'=>'']);
        exit;
    }
public function actionJsoncategories ( ) { header ( 'Content-type: application/json' ) ; $ out = [ ] ; if ( isset ( $ _POST [ 'depdrop_parents' ] ) ) { $ parents = $ _POST [ 'depdrop_parents' ] ; if ( $ parents != null ) { $ mod_table = $ parents [ 0 ] ; $ out = Categories :: jsCategories ( $ mod_table ) ; echo Json :: encode ( [ 'output' => $ out , 'selected' => '' ] ) ; return ; } } echo Json :: encode ( [ 'output' => '' , 'selected' => '' ] ) ; exit ; }
this produces an json array with the available categories for the passed
over module.
this produces an json array with the available categories for the passed over module .