07.18 php saved
joomtex
Tags add more
 
Note
cf helper
  1. <?php
  2.  
  3. class CfHelper extends Helper {
  4.     var $helpers = array('Html','Form');
  5.  
  6.     function display($data,array $options) {
  7.         $output='';
  8.         if(is_array($data) && !empty($data)){
  9.                
  10.                 if($data['multiple_type']==1){
  11.                    
  12.                     $vals = explode(',',$data['values']);
  13.  
  14.                     foreach ($vals as $val){
  15.                         $value[$val]=$val;
  16.                         $values=$value;
  17.                     }
  18.                                        
  19.                                        
  20.                     $output .= $this->Form->label($data['name'],$data['name'].":");
  21.                     $output .= $this->Form->select('caractere'.$data['id'],$values);
  22.                    
  23.                     $output = $this->Html->para('',$output);
  24.                    
  25.                    
  26.                    
  27.                    
  28.                 }else{
  29.                    
  30.                     $output .= $this->Form->input('caractere'.$data['id'],array('div'=>false,'type'=>'text','size'=>'30','label'=>$data['name'],'name'=>'data[Annonce][Caractere]['.$data['id'].']'));
  31.                     $output = $this->Html->para('',$output);
  32.                 }
  33.            
  34.         }
  35.  
  36.  
  37.  
  38.        // return $this->output("<div id=\"".$options['id']."\" class=\"".$options['class']."\">$output</div>");
  39.        return $this->output($output);
  40.     }
  41. }
  42. ?>
Parsed in 0.088 seconds, using GeSHi 1.0.7.14

Modify this Paste