Example #1
0
 public function indexAction()
 {
     $page = $this->request->get('page', 'int', 1);
     $page_size = $this->request->get('page_size', 'int', 10);
     $offset = ($page - 1) * $page_size;
     $dataList = TradeOrder::find(['limit' => ['limit' => $page_size, 'offset' => $offset]]);
     $schema = TradeOrder::getFieldNames();
     $this->view->schema = $schema;
     $this->view->dataList = $dataList;
 }
Example #2
0
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     $fieldNames = TradeOrder::getFieldNames();
     $autoField = ['id'];
     foreach ($fieldNames as $field => $name) {
         if (in_array($field, $autoField)) {
             continue;
         }
         $text = new Text($field);
         $text->setLabel($name);
         $this->add($text);
     }
 }