forked from centurion-project/Centurion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Composite.php
61 lines (56 loc) · 1.68 KB
/
Composite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Centurion
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@centurion-project.org so we can send you a copy immediately.
*
* @category Centurion
* @package Centurion_Form
* @copyright Copyright (c) 2008-2011 Octave & Octave (http://www.octaveoctave.com)
* @license http://centurion-project.org/license/new-bsd New BSD License
* @version $Id$
*/
/**
* @category Centurion
* @package Centurion_Form
* @copyright Copyright (c) 2008-2011 Octave & Octave (http://www.octaveoctave.com)
* @license http://centurion-project.org/license/new-bsd New BSD License
* @author Florent Messa <florent.messa@gmail.com>
* @author Nicolas Duteil <nd@octaveoctave.com>
* @author Laurent Chenay <lc@centurion-project.org>
*/
class Centurion_Form_Composite extends Centurion_Form
{
/**
* Load the default decorators
*
* @return void
*/
public function loadDefaultDecorators()
{
parent::loadDefaultDecorators();
$this->cleanForm();
}
/**
* Render form
*
* @param Zend_View_Interface $view
* @return string
*/
public function render(Zend_View_Interface $view = null)
{
foreach ($this->getElements() as $key => $element) {
if (!$element->hasErrors()) {
continue;
}
$element->setDecorators($this->defaultErrorElementDecorators);
}
return parent::render($view);
}
}