disabling view with in action in ZF2

前端 未结 9 647
滥情空心
滥情空心 2020-12-24 03:10

I am struggling with disabling view in ZF2 $this->_helper->viewRenderer->setNoRender(); or (true) with no luck as it always says there



        
9条回答
  •  一整个雨季
    2020-12-24 03:47

    You can do so using the console model, or kill execution arbitrarily.

     'Hello World',
          ));
    
        }
        // Json Method
        public function jsonAction() {
    
          return new JsonModel(array(
            'message' => 'Hello World',
          ));
    
        }
    
        // This is really exaggerated, but it is quite effective.
    
        public function killAction() {
          echo 'Hello World';
          exit;
        }
    }
    

    In view use: some.phtml

    json.phtml

提交回复
热议问题