Beispiel #1
0
		public function __construct($data, $headers=null, $checkbox=null)
		{
			parent::__construct('table', null, null);
			
			if ($headers != null && is_array($headers))
			{
				$head = html('thead');
				$this->addChild($head);
				
				$row = html('tr');
				
				if ($checkbox != null)
				{
					$row->addChild(html('th', html('span', $checkbox)));
				}
				
				foreach($headers as $header)
				{
					$row->addChild(html('th', $header));
				}
				$head->addChild($row);
			}
			
			$body = html('tbody');
			
			foreach($data as $d)
			{
				$row = html('tr');
				
				if ($checkbox != null)
				{
					$td = html('td', 
						html(
							'input', 
							'type=checkbox name='.$checkbox.'[] value='.$d[$checkbox]
						),
						'class='.$checkbox
					);
					$row->addChild($td);
				}
				foreach($d as $name=>$value)
				{
					if ($name == $checkbox) continue;
					$td = html('td', $value, 'class='.$name);
					$row->addChild($td);
				}
				$body->addChild($row);
			}
			$this->addChild($body);
		}
Beispiel #2
0
		public function __construct($elements=null, $attributes=null, $type='ul')
		{
			parent::__construct($type, null, $attributes);
			
			if ($elements != null)
			{
				assert(is_array($elements));

				foreach($elements as $child)
				{
					$this->addChild($child);
				}
			}
		}
Beispiel #3
0
		/**
		*  Constructor for Docs 
		*/
		public function __construct($title='', $charset='utf-8', $beautify=false)
		{
			parent::__construct('html', null, null, 
				array_merge(
					array('manifest'), 
					Specification::$ATTRIBUTES
				)
			);
			
			$this->docType = html('doctype');
			$this->head = html('head');
			$this->body = html('body');
			$this->title = html('title', $title);
			
			$this->head->addChild(html('meta', 'charset='.$charset));
			$this->head->addChild($this->title);
			
			$this->addChild($this->head);
			$this->addChild($this->body);
		}
Beispiel #4
0
		public function __construct($text)
		{
			parent::__construct($text);
		}
Beispiel #5
0
		public function __construct($children = null)
		{
			parent::__construct('fragment', $children, null);
		}