1: <?php
2:
3: /**
4: * Pry Framework
5: *
6: * LICENSE
7: *
8: * This source file is subject to the new BSD license that is bundled
9: * with this package in the file LICENSE.txt.
10: *
11: */
12:
13: namespace Pry\Form\Element;
14:
15: use Pry\Form\Input;
16:
17: /**
18: * Element submit
19: * @category Pry
20: * @package Form
21: * @subpackage Form_Element
22: * @version 1.0.0
23: * @author Olivier ROGER <oroger.fr>
24: */
25: class Submit extends Input
26: {
27:
28: /**
29: * Constructeur
30: *
31: * @param string $nom
32: * @param Form_Form $form
33: * @access public
34: */
35: public function __construct($nom, $form)
36: {
37: parent::__construct($nom, $form);
38: if (!isset($this->attrs['type']))
39: $this->attrs['type'] = 'submit';
40: }
41:
42: /**
43: * Ecrit l'objet
44: *
45: * @access public
46: * @return unknown
47: */
48: public function __toString()
49: {
50: $css = implode(' ', $this->class);
51: if ($css != '')
52: $css = 'class="' . $css . '"';
53: else
54: $css = '';
55:
56: $attributs = $this->attrsToString();
57: $field = "\t" . '<input ' . $css . ' value="' . htmlspecialchars($this->value) . '" ' . $attributs . ' />' . "\n";
58: if ($this->fieldNewLine)
59: $field.="\t" . '<br />' . "\n";
60: return $field;
61: }
62:
63: }
64:
65: ?>