GridHandler::renderRowInternally PHP Méthode

renderRowInternally() protected méthode

NB: You must have initialized the row before you call this method.
protected renderRowInternally ( $request, $row ) : string
$request PKPRequest
$row GridRow
Résultat string the row HTML
    protected function renderRowInternally($request, $row)
    {
        // Iterate through the columns and render the
        // cells for the given row.
        $renderedCells = array();
        $columns = $this->getColumns();
        foreach ($columns as $column) {
            assert(is_a($column, 'GridColumn'));
            $renderedCells[] = $this->_renderCellInternally($request, $row, $column);
        }
        // Pass control to the view to render the row
        $templateMgr = TemplateManager::getManager($request);
        $templateMgr->assign(array('grid' => $this, 'columns' => $columns, 'cells' => $renderedCells, 'row' => $row));
        return $templateMgr->fetch($row->getTemplate());
    }

Usage Example

 /**
  * @see GridHandler::renderRowInternally()
  */
 protected function renderRowInternally($request, $row)
 {
     if ($this->getCategoryRowIdParameterName()) {
         $param = $this->getRequestArg($this->getCategoryRowIdParameterName());
         $templateMgr = TemplateManager::getManager($request);
         $templateMgr->assign('categoryId', $param);
     }
     return parent::renderRowInternally($request, $row);
 }