public function endsWith($sub, $message = null)
    {
        $this->setRule(__FUNCTION__, function($val, $args)
                       {
                           $sub = $args[0];
                           return (strlen($val) === 0 || substr($val, -strlen($sub)) === $sub);
                       }, $message, array($sub));
        return $this;
    }
public function endsWith($sub, $message = null)
    {
        $this->setRule(__FUNCTION__, function($val, $args)
                       {
                           $sub = $args[0];
                           return (strlen($val) === 0 || substr($val, -strlen($sub)) === $sub);
                       }, $message, array($sub));
        return $this;
    }
public function endsWith ( $ sub , $ message = null ) { $ this -> setRule ( __FUNCTION__ , function ( $ val , $ args ) { $ sub = $ args [ 0 ] ; return ( strlen ( $ val ) === 0 || substr ( $ val , - strlen ( $ sub ) ) === $ sub ) ; } , $ message , array ( $ sub ) ) ; return $ this ; }
Field must end with a specific substring.

@param string $sub
@param string $message
@return FormValidator
Field must end with a specific substring .