Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Registry

Classes

  • Form_Element_AutoCompleter
  • Form_Element_Checkbox
  • Form_Element_Colorpicker
  • Form_Element_Date
  • Form_Element_DatePicker
  • Form_Element_Email
  • Form_Element_File
  • Form_Element_Hidden
  • Form_Element_Html
  • Form_Element_Ip
  • Form_Element_Mac
  • Form_Element_Multi
  • Form_Element_NumericStepper
  • Form_Element_Password
  • Form_Element_Radio
  • Form_Element_Select
  • Form_Element_Slider
  • Form_Element_Submit
  • Form_Element_Text
  • Form_Element_Textarea
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Pry Framework
 4:  *
 5:  * LICENSE
 6:  *
 7:  * This source file is subject to the new BSD license that is bundled
 8:  * with this package in the file LICENSE.txt.
 9:  * 
10:  * @version $Revision: 276 $
11:  */
12: 
13: /**
14:  * Représentation des élément a choix multiple (select, radio)
15:  * @category Pry
16:  * @package Form
17:  * @subpackage Form_Element
18:  * @abstract
19:  * @version 1.1.0 
20:  * @author Olivier ROGER <oroger.fr>
21:  */
22: abstract class Form_Element_Multi extends Form_Field
23: {
24:     
25:     /**
26:      * Liste des choix possible
27:      *
28:      * @var array
29:      * @access protected
30:      */
31:     protected $choix;
32:     
33:     /**
34:      * Constructeur
35:      *
36:      * @param string $nom
37:      * @param Form_Form $form
38:      * @access public
39:      */
40:     public function __construct($nom,$form)
41:     {
42:         parent::__construct($nom,$form);
43:         $this->attrs['name'] = $nom;
44:     }
45:     
46:     /**
47:      * Enregistre les choix possibles
48:      *
49:      * @param array $choix La clé = valeur html du code html , la valeur = valeur afficher à l'utilisateur
50:      * @access public
51:      * @return Form_Element_Multi
52:      */
53:     public function choices(array $choix)
54:     {
55:         if(is_array($choix))
56:             $this->choix = $choix;
57:         else
58:             throw new InvalidArgumentException('Le/les choix doivent être un array');
59:         return $this;
60:     }
61:     
62:     public function setAttributes($nom,$valeur)
63:     {
64:         if(!isset($this->attrs[$nom]))
65:             $this->attrs[$nom] = $valeur;
66:     }
67: }
68:  ?>
Pry Framework API documentation generated by ApiGen 2.6.1