示例#1
0
文件: Table.php 项目: pracj3am/osto
 /**
  * Selects columns to query.
  * @param  string|array|Table\Column  column name or array of column names
  * @param  string        column alias
  * @return Table         provides a fluent interface
  */
 public function select($col, $as = NULL)
 {
     if (\is_array($col)) {
         $col2 = array();
         foreach ($col as $k => $c) {
             $col2[$this->_translateColumns($k)] = $this->_translateColumns((string) $c);
         }
         unset($col);
         $col = $col2;
     } else {
         $col = $this->_translateColumns((string) $col);
     }
     $this->dataSource->select($col, $as);
     return $this;
 }
示例#2
0
<body> 
<?php 
$panel1 = new MasterPanel('panel1');
$panel1->create();
$panel1->start();
$row1 = new RowPanel('row1');
$row1->create();
$row1->start();
$column1 = new ColumnPanel('column1', 6, 'md');
$column1->create();
$column1->start();
?>
<h1>This is a drop down list.</h1>
<?php 
$newddlSource = new DataSource('articles', null);
$ddlValues = $newddlSource->select();
$newddl = new DropDownList('test1', 'test2', 'test3', $ddlValues, "title", "id");
$newddl->create();
$newddl->display();
$column1->close();
$column2 = new ColumnPanel('column2', 6, 'md');
$column2->create();
$column2->start();
?>
<h1>This is a text box.</h1>
<?php 
$newTB = new TextBox('test1', 'test2', 'test3', 'test4');
$newTB->create();
$newTB->display();
$column2->close();
$row1->close();