31 lines
701 B
PHP
31 lines
701 B
PHP
<?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 = 'assets/code/'.$method.'-'.$langage.'.txt';
|
|
if (file_exists($fichier)){
|
|
$url = $this->view->url(
|
|
array(
|
|
'controller' => 'documentation',
|
|
'action' => 'code',
|
|
'langage' => $langage,
|
|
'element' => $method,
|
|
), null, true);
|
|
$exemple.= '<a href="'.$url.'">' . $lib . '</a>';
|
|
$exemple.= ' ';
|
|
}
|
|
}
|
|
return $exemple;
|
|
}
|
|
} |