Exemplo n.º 1
0
 /**
  * @param  null      $role
  * @return RowAction
  */
 public function cmsAction($role = null)
 {
     $route = 'ojs_admin_page_index';
     $rowAction = new RowAction('<i class="fa fa-anchor"></i>', $route);
     $rowAction->setAttributes(['class' => 'btn btn-info btn-xs  ', 'data-toggle' => 'tooltip', 'title' => "CMS"]);
     $rowAction->setRouteParameters(['id', 'object']);
     $rowAction->setRoute($route);
     if ($role) {
         $rowAction->setRole($role);
     }
     $postExtension = $this->postExtension;
     $rowAction->manipulateRender(function (RowAction $action, Row $row) use($postExtension) {
         $entity = $row->getEntity();
         $object = $postExtension->cmsobject($entity);
         $action->setRouteParameters(['id', 'object' => $object]);
         return $action;
     });
     return $rowAction;
 }