controllers/RuleController.php
public function actionCheckname(){
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['checkname']);
        }
        $model = new BizRule(null);
        $mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
        if($mo==null){
            return ['message'=>true];
        }else{
            return ['message'=>false];
        }

    }
public function actionCheckname(){
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['checkname']);
        }
        $model = new BizRule(null);
        $mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
        if($mo==null){
            return ['message'=>true];
        }else{
            return ['message'=>false];
        }

    }
public function actionCheckname ( ) { $ request = \ Yii :: $ app -> request ; if ( $ request -> getIsOptions ( ) ) { return $ this -> ResponseOptions ( $ this -> verbs ( ) [ 'checkname' ] ) ; } $ model = new BizRule ( null ) ; $ mo = $ model -> find ( Yii :: $ app -> request -> post ( ) [ 'BizRule' ] [ 'name' ] ) ; if ( $ mo == null ) { return [ 'message' => true ] ; } else { return [ 'message' => false ] ; } }
check is a new item
@return boolan
check is a new item