Bootstrapper\Form::getFormattedError PHP Method

getFormattedError() public method

Get the formatted errors for the form element with the given name.
public getFormattedError ( string $name ) : string
$name string
return string
    public function getFormattedError($name)
    {
        if (!$this->hasErrors($name)) {
            // If the form element does not have any errors, return
            // an emptry string.
            return '';
        }
        // Get the errors from the session.
        $errors = $this->getSessionStore()->get('errors');
        // Return the formatted error message, if the form element has any.
        return $errors->first($this->transformKey($name), $this->help(':message'));
    }

Usage Example

コード例 #1
0
ファイル: _ide_helper.php プロジェクト: birdiebel/G2016
 /**
  * Get the formatted errors for the form element with the given name.
  *
  * @param string $name
  * @return string 
  * @static 
  */
 public static function getFormattedError($name)
 {
     return \Bootstrapper\Form::getFormattedError($name);
 }