public function callbackValidVideoUrl($sUrl)
    {
        $sId = $this->blog_post_model->extractYoutubeId($sUrl);

        if (!empty($sId)) {

            return true;

        } else {

            $sId = $this->blog_post_model->extractVimeoId($sUrl);

            if (!empty($sId)) {

                return true;

            } else {

                $oFormValidation = Factory::service('FormValidation');
                $oFormValidation->set_message('_callbackValidVideoUrl', 'Not a valid YouTube or Vimeo URL.');
                return false;
            }
        }
    }
public function callbackValidVideoUrl($sUrl)
    {
        $sId = $this->blog_post_model->extractYoutubeId($sUrl);

        if (!empty($sId)) {

            return true;

        } else {

            $sId = $this->blog_post_model->extractVimeoId($sUrl);

            if (!empty($sId)) {

                return true;

            } else {

                $oFormValidation = Factory::service('FormValidation');
                $oFormValidation->set_message('_callbackValidVideoUrl', 'Not a valid YouTube or Vimeo URL.');
                return false;
            }
        }
    }
public function callbackValidVideoUrl ( $ sUrl ) { $ sId = $ this -> blog_post_model -> extractYoutubeId ( $ sUrl ) ; if ( ! empty ( $ sId ) ) { return true ; } else { $ sId = $ this -> blog_post_model -> extractVimeoId ( $ sUrl ) ; if ( ! empty ( $ sId ) ) { return true ; } else { $ oFormValidation = Factory :: service ( 'FormValidation' ) ; $ oFormValidation -> set_message ( '_callbackValidVideoUrl' , 'Not a valid YouTube or Vimeo URL.' ) ; return false ; } } }
Form Validation callback, checks that a YouTube or Vimeo ID can be extracted from the string
@param  string  $sUrl The URL to check
@return boolean
Form Validation callback checks that a YouTube or Vimeo ID can be extracted from the string