Modification du controller pour afficher la documentation du service et implémentation dans les templates

This commit is contained in:
Michael RICOIS 2010-09-17 14:49:18 +00:00
parent 4c96305413
commit be18f7219a
3 changed files with 41 additions and 2 deletions

View File

@ -17,9 +17,33 @@ class IndexController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
require_once 'Web/WebClassDoc.php';
//Gestion des types de données
$classmap = array(
'IdentiteReturnType' => 'IdentiteReturnType',
'IdentiteResultType' => 'IdentiteResultType',
'GeoInfos' => 'GeoInfos',
'IdentiteBilan' => 'IdentiteBilan',
'IdentiteBourse' => 'IdentiteBourse',
'RechercheEntrepriseType' => 'RechercheEntrepriseType',
'CriteresEntreprise' => 'CriteresEntreprise',
'CriteresDirigeant' => 'CriteresDirigeant',
'RechercheEntrepriseResult' => 'RechercheEntrepriseResult',
'RechercheEntrepriseReponses' => 'RechercheEntrepriseReponses',
'ErrorType' => 'ErrorType',
'StatusResultType' => 'StatusResultType',
);
$doc = new WebClassDoc('WsEntreprise', $classmap);
$tabServiceMethods = $doc->getServiceMethods();
$tabServiceTypes = $doc->getServiceTypes();
$this->view->assign('serviceMethods', $tabServiceMethods);
$this->view->assign('serviceTypes', $tabServiceTypes);
} }
} }

View File

@ -0,0 +1,15 @@
<?php foreach ($this->serviceMethods as $method) {?>
<div>
<p><?=$this->docMethod($method)?><p>
<div style="border:1px solid;">
Description : <?=$this->docDescription($method)?>
</div>
<div style="border:1px solid;">
Paramètres : <?=$this->docParameter($method['params'], $this->serviceTypes)?>
</div>
<div style="border:1px solid;">
Retour : <?=$this->docReturn($method['return'], $this->serviceTypes)?>
</div>
</div>
<br/>
<?php } ?>

View File

@ -1,5 +1,5 @@
<?= $this->doctype() ?> <?= $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<?= $this->headMeta() ?> <?= $this->headMeta() ?>
<?= $this->headTitle() ?> <?= $this->headTitle() ?>