Example #1
0
 function preloadTable($table = NULL, $doCols = true)
 {
     if (!$table) {
         require_once '../classes/Table.php';
         $table = new Table();
     }
     if ($doCols) {
         $table->columns($this->columns());
     }
     if ($this->name) {
         $table->parameters(array('rpt' => $this->name, 'rpt_colnames' => $this->columnNames()));
     }
 }
$a = new A("Link", "http://www.google.com", array("style" => "color:blue"));
echo $a;
$h1 = new H("1", "This is a h1");
$h2 = new H("2", "This is a h2");
echo $h1 . $h2;
$hr = new HR();
$h1->setContents("This is the new contents");
echo $hr . $h1 . $h2;
$p = new P();
$br = new BR();
$p->setContents("This is some {$br} contents");
echo $p;
$comment = new Comment("This is commented out");
echo $comment;
$img = new Img("https://i.ytimg.com/vi/KY4IzMcjX3Y/maxresdefault.jpg", "This is a dog", array("width" => "100", "height" => "100"));
echo $img;
$table = new Table();
$table->columns(array("col1", "col2", "col3"));
$table->addRow(array("data col1", "data col2", "data col3"));
echo $table;
$list = new BootstrapList();
$list->addLi("item 1")->addLi("item 2");
echo $list;
$div = new Div();
$div->setContents($p . $img);
echo $div;
$span = new Span();
$span->setContents("This is a span");
$div->setContents($span->setContents("This is some new content"));
echo $div;
 function pageTable($page, $table = NULL, $doCols = true)
 {
     if (!isset($this->cache['page']) or $page != $this->cache['page']) {
         $this->cache['page'] = $page;
         $this->_save();
     }
     $this->_cachePage($page);
     if (!$table) {
         require_once '../classes/Table.php';
         $table = new Table();
     }
     if ($doCols) {
         $table->columns($this->columns());
     }
     if ($this->name) {
         $table->parameters(array('rpt' => $this->name, 'rpt_colnames' => $this->columnNames()));
     }
     $table->start();
     foreach ($this->cache['rows'] as $row) {
         $table->row($row);
     }
     $table->end();
 }