public function allowsElement($name)
    {
        if (!empty($this->currentNesting)) {
            $parent_token = array_pop($this->currentNesting);
            $this->currentNesting[] = $parent_token;
            $parent = $this->htmlDefinition->info[$parent_token->name];
        } else {
            $parent = $this->htmlDefinition->info_parent_def;
        }
        if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) {
            return false;
        }
        // check for exclusion
        for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
            $node = $this->currentNesting[$i];
            $def  = $this->htmlDefinition->info[$node->name];
            if (isset($def->excludes[$name])) {
                return false;
            }
        }
        return true;
    }
public function allowsElement($name)
    {
        if (!empty($this->currentNesting)) {
            $parent_token = array_pop($this->currentNesting);
            $this->currentNesting[] = $parent_token;
            $parent = $this->htmlDefinition->info[$parent_token->name];
        } else {
            $parent = $this->htmlDefinition->info_parent_def;
        }
        if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) {
            return false;
        }
        // check for exclusion
        for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
            $node = $this->currentNesting[$i];
            $def  = $this->htmlDefinition->info[$node->name];
            if (isset($def->excludes[$name])) {
                return false;
            }
        }
        return true;
    }
public function allowsElement ( $ name ) { if ( ! empty ( $ this -> currentNesting ) ) { $ parent_token = array_pop ( $ this -> currentNesting ) ; $ this -> currentNesting [ ] = $ parent_token ; $ parent = $ this -> htmlDefinition -> info [ $ parent_token -> name ] ; } else { $ parent = $ this -> htmlDefinition -> info_parent_def ; } if ( ! isset ( $ parent -> child -> elements [ $ name ] ) || isset ( $ parent -> excludes [ $ name ] ) ) { return false ; } // check for exclusion for ( $ i = count ( $ this -> currentNesting ) - 2 ; $ i >= 0 ; $ i -- ) { $ node = $ this -> currentNesting [ $ i ] ; $ def = $ this -> htmlDefinition -> info [ $ node -> name ] ; if ( isset ( $ def -> excludes [ $ name ] ) ) { return false ; } } return true ; }
Tests if the context node allows a certain element
@param string $name Name of element to test for
@return bool True if element is allowed, false if it is not
Tests if the context node allows a certain element