Exemplo n.º 1
0
 /**
  * Using a model
  */
 public function crudAction()
 {
     $grid = $this->grid();
     $b = new Bugs();
     $grid->setSource(new Bvb_Grid_Source_Zend_Table($b));
     $grid->setColumnsHidden(array('bug_id', 'time', 'verified_by', 'next'));
     $form = new Bvb_Grid_Form();
     $form->setFormTitle('Manage Records');
     $form->setAdd(true)->setEdit(true)->setDelete(true)->setAddButton(true)->setSaveAndAddButton(true);
     #$grid->setDetailColumns();
     $grid->setForm($form);
     $grid->setDeleteConfirmationPage(true);
     $this->view->pages = $grid->deploy();
     $this->render('index');
 }
Exemplo n.º 2
0
 public function testFormWithModel()
 {
     $this->grid->setSource(new Bvb_Grid_Source_Zend_Table(new Bugs()));
     $this->grid->setParam('add', 1);
     $form = new Bvb_Grid_Form();
     $form->setView(new Zend_View());
     $form->setAdd(true)->setEdit(true)->setDelete(true);
     $this->grid->setForm($form);
     $grid = $this->grid->deploy();
     $this->controller->getResponse()->setBody($grid);
     $this->assertQuery("form");
     $this->assertQuery("[@id='1-bug_description']");
 }