2010-09-30 07:15:53 +00:00
|
|
|
<?php
|
|
|
|
class Zend_View_Helper_DocExemple extends Zend_View_Helper_Abstract
|
|
|
|
{
|
|
|
|
public function docExemple($method)
|
|
|
|
{
|
|
|
|
$exemple = '';
|
|
|
|
$langages = array(
|
|
|
|
'php' => 'PHP',
|
|
|
|
'java' => 'Java',
|
|
|
|
'perl' => 'Perl',
|
|
|
|
'python' => 'Python',
|
|
|
|
'csharp' => 'C#'
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($langages as $langage => $lib){
|
|
|
|
$fichier = 'code/'.$method.'-'.$langage.'.txt';
|
|
|
|
if (file_exists($fichier)){
|
2010-10-20 12:30:25 +00:00
|
|
|
$exemple.= '<a href="documentation/code?langage=' . $langage .
|
2010-09-30 07:15:53 +00:00
|
|
|
'&element=' . $method . '">' . $lib . '</a>';
|
|
|
|
$exemple.= ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $exemple;
|
|
|
|
}
|
|
|
|
}
|