Handling input with the Zend Framework (Post,get,etc)

前端 未结 6 1539
闹比i
闹比i 2021-02-01 05:04

im re-factoring php on zend code and all the code is full of $_GET[\"this\"] and $_POST[\"that\"]. I have always used the more phpish $this->_

6条回答
  •  不思量自难忘°
    2021-02-01 05:46

    $dataGet  = $this->getRequest()->getParam('id',null);
    $valid = new Zend_Validate_Digits();
    
    if( isset($dataGet) && $valid->isValid($dataGet) ){
     // do some...
    } else{
      // not set
    }
    

提交回复
热议问题