core-bundle/src/Resources/contao/library/Contao/Widget.php
public function generateWithError($blnSwitchOrder=false)
	{
		$strWidget = $this->generate();
		$strError = $this->getErrorAsHTML();

		return $blnSwitchOrder ? $strWidget . $strError : $strError . $strWidget;
	}
public function generateWithError($blnSwitchOrder=false)
	{
		$strWidget = $this->generate();
		$strError = $this->getErrorAsHTML();

		return $blnSwitchOrder ? $strWidget . $strError : $strError . $strWidget;
	}
Generate the widget with error message and return it as string

@param boolean $blnSwitchOrder If true, the error message will be shown below the field

@return string The form field markup