private function checkImageAltTags() {

        $html = $this->getPageContent();

        // for newly created page
        if ($html == '') {
            return false;
        }

        $dom = $this->createDOMDocumentFromHTML($html);

        $images = $dom->getElementsByTagName('img');

        $imagesWithAltTags = 0;
        foreach($images as $image){
            if($image->hasAttribute('alt') && $image->getAttribute('alt') != ''){
                $imagesWithAltTags++;
            }
        }
        if($imagesWithAltTags == $images->length){
            return true;
        }

        return false;
    }
private function checkImageAltTags() {

        $html = $this->getPageContent();

        // for newly created page
        if ($html == '') {
            return false;
        }

        $dom = $this->createDOMDocumentFromHTML($html);

        $images = $dom->getElementsByTagName('img');

        $imagesWithAltTags = 0;
        foreach($images as $image){
            if($image->hasAttribute('alt') && $image->getAttribute('alt') != ''){
                $imagesWithAltTags++;
            }
        }
        if($imagesWithAltTags == $images->length){
            return true;
        }

        return false;
    }
private function checkImageAltTags ( ) { $ html = $ this -> getPageContent ( ) ; // for newly created page if ( $ html == '' ) { return false ; } $ dom = $ this -> createDOMDocumentFromHTML ( $ html ) ; $ images = $ dom -> getElementsByTagName ( 'img' ) ; $ imagesWithAltTags = 0 ; foreach ( $ images as $ image ) { if ( $ image -> hasAttribute ( 'alt' ) && $ image -> getAttribute ( 'alt' ) != '' ) { $ imagesWithAltTags ++ ; } } if ( $ imagesWithAltTags == $ images -> length ) { return true ; } return false ; }
checkImageAltTags.
Checks if images in content have alt tags

@param none
@return boolean
checkImageAltTags . Checks if images in content have alt tags