Exemplo n.º 1
0
 public function addElement(ElementInterface $element)
 {
     $id = $element->getId();
     if (!isset($this->elements[$id])) {
         $this->elements[$id] = $element;
     }
 }
Exemplo n.º 2
0
 /**
  * @param Request $request
  * @param ElementInterface $element
  * @return DataGridView
  */
 protected function getData(Request $request, ElementInterface $element)
 {
     $datasource = $element->getSource($this->dataSourceFactory);
     $datasource->bindParameters($request);
     $datagrid = $element->getGrid($this->datagridFactory);
     $datagrid->setData($datasource->getResult());
     return $datagrid->createView();
 }
Exemplo n.º 3
0
 /**
  * @param ElementInterface $element
  * @param mixed $data
  * @return FormInterface
  */
 protected function getForm(ElementInterface $element, $data = null)
 {
     $options = ['method' => 'PUT'];
     if (!$data) {
         $options['method'] = 'POST';
     }
     return $element->getForm($this->formFactory, $data, $options);
 }