public function getLocationByWhIdAction() { if ($this->_request->getParam('wh_id')) { $wh_id = $this->_request->getParam('wh_id'); $type_id = $this->_request->getParam('type_id'); $temp = explode("-", $type_id); $type = implode(",", $temp); $coldchain = new Model_ColdChain(); $result = $coldchain->getLocationByWhId($wh_id, $type); } else { $result = array("error" => "Please provide wh_id param. e.g. (?wh_id=1)"); } echo Zend_Json::encode($result); }