<?php

class Tag_Heading extends Tag
{
	static $level = 2;

	public function __construct($contents='',$level=null,$attributes=array())
	{
		if( !is_null($level) )
			self::$level = $level;
		parent::__construct('h'.self::$level, $attributes, TAG_CLOSE);
		if( !is_array($contents) && !is_object($contents))
			$this->text($contents);
		if( is_array($contents) )
			foreach($contents as $node)
				$this->addChild($node);
		if( $contents instanceof Tag )
			$this->addChild($contents);
	}
}
