test index in array

This commit is contained in:
Michael RICOIS 2013-05-06 19:55:40 +00:00
parent b8191c3fe1
commit 9703c8e258

View File

@ -1,25 +1,23 @@
<h1>Liste des services disponibles</h1>
<ul>
<?php foreach ($this->ws as $key => $ws) {?>
<li>
<?php if ($ws['type'] == 'client'){?>
<a href="<?=$this->url(array('controller' => 'documentation', 'action' => 'clients', 'nom' => strtolower($key)))?>">
<?=ucfirst($key)?>
</a>
<?php if (array_key_exists('type', $ws) && $ws['type'] == 'client') {?>
<a href="<?=$this->url(array('controller' => 'documentation', 'action' => 'clients', 'nom' => strtolower($key)))?>">
<?=ucfirst($key)?>
</a>
<?php } else {?>
<a href="<?=$this->url(array('controller' => 'documentation', 'ws' => $key))?>">
<?=ucfirst($key)?>
</a>
<a href="<?=$this->url(array('controller' => 'documentation', 'ws' => $key))?>">
<?=ucfirst($key)?>
</a>
<?php }?>
</li>
<?php if (isset($ws['version'])){ ?>
<?php if (isset($ws['version'])) { ?>
<ul>
<?php
foreach ($ws['version'] as $version => $versionElement){
if ($versionElement['actif']) {
?>
<?php foreach ($ws['version'] as $version => $versionElement) { ?>
<?php if ($versionElement['actif']) { ?>
<li>
<?php if ($ws['type'] == 'client'){?>
<a href="<?=$this->url(array(
@ -35,16 +33,14 @@
'version' => $version,
))?>">Version <?=$version?></a>
<?php }?>
<?php echo ( $versionElement['defaut']) ? '(défaut)' : '';?>
</li>
<?php
}
}
?>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
<?php } ?>
</ul>