示例#1
0
文件: Col.php 项目: sudar69/hermes
 public function __invoke(ColModel $dashboard)
 {
     foreach ($dashboard->getWidgets() as $element) {
         if (get_class($element) == 'Inventory\\Model\\WidgetTable') {
             $cols .= $this->getView()->widget_table_helper($element);
         } elseif (get_class($element) == 'Inventory\\Model\\WidgetView') {
             $cols .= $this->getView()->widget_view_helper($element);
         }
     }
     $html = '<!-- Content Col -->
   <div class="col-md-' . $dashboard->getClasssize() . '">' . $cols . '</div>
   <!-- /.col -->';
     return $html;
 }
示例#2
0
 public function viewAction()
 {
     $page = $this->confPage();
     $page->setActivePage(1);
     $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
     //Page2
     $request = $this->getRequest();
     if ($request->isPost()) {
         $post = $request->getPost();
     }
     $widgetView = new WidgetView($em, $this->params()->fromRoute('id', 1), 'addr_view', $this->params()->fromQuery('addr_view_mode', 'view'), new DekaAddresses(), 'Inventory\\Entity\\DekaAddresses');
     $widgetView->setPost($post);
     $col2 = new Col();
     $col2->addWidget($widgetView);
     $row2 = new Row();
     $row2->addCol($col2);
     $dashboard2 = new Dashboard();
     $dashboard2->setId("2");
     $dashboard2->setName("Параметры");
     $dashboard2->setUrl("view");
     $dashboard2->addRow($row2);
     $page->setDashboard($dashboard2);
     $view = new ViewModel(array('dashboard' => $page));
     $view->setTemplate('inventory/addr/index');
     return $view;
 }