src/Component.php
private function errorMessage($rule, $param = null)
    {
        if ($rule == 'remote' && isset($this->errors[$param])) {
            return $this->errorMessage($param);
        }
        if (is_null($param)) {
            $param = '';
        }
        $params = array_pad((array) $param, 2, '');

        return (isset($this->errors[$rule])) ? str_replace(array('{0}', '{1}'), $params, $this->errors[$rule]) : null;
    }
private function errorMessage($rule, $param = null)
    {
        if ($rule == 'remote' && isset($this->errors[$param])) {
            return $this->errorMessage($param);
        }
        if (is_null($param)) {
            $param = '';
        }
        $params = array_pad((array) $param, 2, '');

        return (isset($this->errors[$rule])) ? str_replace(array('{0}', '{1}'), $params, $this->errors[$rule]) : null;
    }
private function errorMessage ( $ rule , $ param = null ) { if ( $ rule == 'remote' && isset ( $ this -> errors [ $ param ] ) ) { return $ this -> errorMessage ( $ param ) ; } if ( is_null ( $ param ) ) { $ param = '' ; } $ params = array_pad ( ( array ) $ param , 2 , '' ) ; return ( isset ( $ this -> errors [ $ rule ] ) ) ? str_replace ( array ( '{0}' , '{1}' ) , $ params , $ this -> errors [ $ rule ] ) : null ; }
A helper method to retrieve the associated error message when something goes wrong.

@param string $rule
@param mixed  $param

@return null|string
A helper method to retrieve the associated error message when something goes wrong .