public function ajaxgetclientAction() { if ($_POST) { switch ($_POST['clienttype']) { case 2: $client = new FM_Components_Business(array('id' => $_POST['id'])); print Zend_Json::encode($client->toArray()); break; case 3: $client = new FM_Components_NonProfit(array('id' => $_POST['id'])); print Zend_Json::encode($client->toArray()); break; case 4: $client = new FM_Components_Sports(array('id' => $_POST['id'])); print Zend_Json::encode($client->toArray()); break; } } exit; }