本文整理汇总了PHP中GridCellProvider::render方法的典型用法代码示例。如果您正苦于以下问题:PHP GridCellProvider::render方法的具体用法?PHP GridCellProvider::render怎么用?PHP GridCellProvider::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridCellProvider
的用法示例。
在下文中一共展示了GridCellProvider::render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* @see GridCellProvider::render()
*/
function render($request, $row, $column)
{
// Default category rows will only have the first column
// as label columns.
if ($column->hasFlag('firstColumn')) {
// Store the current column template.
$template = $column->getTemplate();
// Reset to the default column template.
$column->setTemplate('controllers/grid/gridCell.tpl');
// Render the cell.
$renderedCell = parent::render($request, $row, $column);
// Restore the original column template.
$column->setTemplate($template);
return $renderedCell;
} else {
return '';
}
}
示例2: _renderCellInternally
/**
* Method that renders a cell.
*
* NB: You must have initialized the row
* before you call this method.
*
* @param $request PKPRequest
* @param $row GridRow
* @param $column GridColumn
* @return string the cell HTML
*/
private function _renderCellInternally($request, $row, $column)
{
// If there is no object, then we want to return an empty row.
// override the assigned GridCellProvider and provide the default.
$element =& $row->getData();
if (is_null($element) && $row->getIsModified()) {
import('lib.pkp.classes.controllers.grid.GridCellProvider');
$cellProvider = new GridCellProvider();
return $cellProvider->render($request, $row, $column);
}
// Otherwise, get the cell content.
// If row defines a cell provider, use it.
$cellProvider = $row->getCellProvider();
if (!is_a($cellProvider, 'GridCellProvider')) {
// Remove reference to the row variable.
unset($cellProvider);
// Get cell provider from column.
$cellProvider = $column->getCellProvider();
}
return $cellProvider->render($request, $row, $column);
}