Пример #1
0
 function make_page()
 {
     // pass in what you want to use for the html tag attributes as array in the first function,
     // and a page title for the second (if one is not provided inside $this->head)
     if ($this->title != null) {
         $this->head[] = new _title($this->title);
     }
     echo "<!doctype html>";
     $result = new _html(array(new _head($this->head, $this->h_at), new _body($this->body)), $this->b_at);
     echo $result->make();
     // we may just want to add a variable to allow for us to keep an object
     // after echoing out for other operations (mainly encoding json)
     if (!class_exists('json_core')) {
         foreach ($this as $key => $value) {
             unset($this->{$key});
         }
     }
 }
Пример #2
0
										new _div( $content,
												array('id'=>'main','role'=>'main')
											),
										new _footer(
											new _h4("Ronaldo Barbachano 2011
			<a href='http://www.linkedin.com/in/ronaldob' title=Linkedin>Linked In</a>
			<a href='https://launchpad.net/%7Eronaldo-barbachano' title=Launchpad>Launchpad</a>
			<a href='https://github.com/redcap3000' title=github>Github</a>")
										)
										
										),array('id'=>'container')
								
								)));						

// create html object with page above
$the_page = new _html($page);

// make it
echo $the_page->make();

// Clean up the page for json storage..
$a= json_core::json_clean($the_page);

// Echo's out the string
echo json_encode($a,true);

// Read in 'clean' structure to json page
// Can also pass json as string to core..
$c = json_core::json_to_page($a);

// Make it again from json!