public setElementType ( string $element_name, ELEMENT_TYPE_BLOCK | ELEMENT_TYPE_INLINE $type ) : null | ||
$element_name | string | Element name, e.g. "b". |
$type | ELEMENT_TYPE_BLOCK | ELEMENT_TYPE_INLINE | |
return | null |
public function setElementType($element_name, $type)
{
if ($type === static::ELEMENT_TYPE_BLOCK) {
$this->inline_elements = array_diff($this->inline_elements, array($element_name));
} else {
if ($type === static::ELEMENT_TYPE_INLINE) {
$this->inline_elements[] = $element_name;
} else {
throw new Exception\InvalidArgumentException('Unrecognized element type.');
}
}
$this->inline_elements = array_unique($this->inline_elements);
}