Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

addition of getValidation and setValidation #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion Interpreter/Html/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
*
* The <form /> component.
*
* @author Julien Clauzel <[email protected]>
* @author Ivan Enderlin <[email protected]>
* @copyright Copyright © 2007-2013 Ivan Enderlin.
* @license New BSD License
Expand Down Expand Up @@ -138,6 +139,7 @@ class Form extends Generic implements \Hoa\Xyl\Element\Executable {

protected static $_interpreter = null;

protected $_validation = array();


/**
Expand Down Expand Up @@ -429,7 +431,9 @@ public function isValid ( $revalid = false ) {

$handle = $handle && $verdict;
});


$this->setValidation($validation);

self::postVerification($this->_validity, $this);

if(true === $this->_validity)
Expand Down Expand Up @@ -632,6 +636,34 @@ public static function getMe ( Concrete $element ) {

return $form[0];
}

/**
* Get element's validation array
*
* @access public
* @return Array
*/
public function getValidation () {

return $this->_validation;
}

/**
* Set element's validation array
*
* @access public
* @param Array $validation Validation
* @return Array
*/
public function setValidation ( $validation ) {

$old = $this->getValidation();
$this->_validation = $validation;

return $old;
}


}

}