render cell template.

@param string $columnName

@return string
350146
public function renderCellTemplate($columnName)
    {
        if ($columnName == 'attribute') {
            return $this->_getAttributeRenderer()
                ->setName($this->_getCellInputElementName($columnName))
                ->setTitle($columnName)
                ->setClass($this->className)
                ->setOptions(
                    $this->getElement()->getValues()
                )
                ->toHtml();
        } elseif ($columnName == 'conditions') {
            return $this->_getConditionsRenderer()
                ->setName($this->_getCellInputElementName($columnName))
                ->setTitle($columnName)
                ->setClass($this->className)
                ->setOptions(
                    $this->condition->toOptionArray()
                )
                ->toHtml();
        } elseif ($columnName == 'cvalue') {
            return $this->_getValueRenderer()
                ->setName($this->_getCellInputElementName($columnName))
                ->setTitle($columnName)
                ->setClass($this->className)
                ->setOptions(
                    $this->value->toOptionArray()
                )
                ->toHtml();
        }

        return parent::renderCellTemplate($columnName);
    }
335456
public function getColumnType($tableName, $columnName) {
        $columns = $this->getTableColumns($tableName);
        foreach ($columns as $column) {
            if ($column['Field'] != $columnName)
                continue;
            $type = explode('(', $column['Type'], 2);
            return $type[0];
        }
        throw new \Exception("Column `$columnName` not found in table `$tableName`!");
    }
515189
public function render( $filename )
	{
		try
		{
			ob_start();

			$this->_include( $filename );

			return ob_get_clean();
		}
		catch( Exception $e )
		{
			ob_end_clean();
			throw $e;
		}
	}
663900
protected function renderTagColumn( $item, $column_name ) {

		$html = Catalog::tagsToString( $item[ $column_name ] );

		if ( ! $html ) {
			$html = '<span style="color:silver">n/a</span>';
		}

		// Build row actions
		$actions = [
			'edit_tags' => sprintf(
				'<a href="?page=%s&action=%s&ID=%s">%s</a>',
				$_REQUEST['page'],
				'edit_tags',
				$item['ID'],
				__( 'Edit Tags', 'pressbooks' )
			),
		];

		// Return the title contents
		return sprintf(
			'%1$s %2$s',
			$html,
			$this->row_actions( $actions )
		);

	}
1081124
public function renderTableHeader()
    {
        $cells = [];
        foreach ($this->columns as $column) {
            /* @var $column TreeColumn */
            $cells[] = $column->renderHeaderCell();
        }
        $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);
        return "<thead>\n" . $content . "\n</thead>";
    }
682458
public function renderAsTable() {
    $html = '';
    foreach ($this->cells as $iRow => $rowCells) {
      $rowHtml = '';
      foreach ($rowCells as $iCol => $cell) {
        $rowHtml .= $cell->render();
      }
      $html .= '    <tr>' . $rowHtml . '</tr>' . "\n";
    }
    return "<table>\n  <tbody>\n" . $html . "  </tbody>\n</table>\n";
  }
47998
public function renderCreateColumns()
    {
        $columns = $this->getTableColumns();

        if (!$columns) {
            return '';
        }

        $source = '';

        foreach ($columns as $column) {
            $attributes = [$this->serializeArrayToAttributes($column->getName())];
            $type       = $column->getType()->getName();

            switch ($type) {
                case Type::INTEGER:
                    $method = 'integer';
                    break;
                case Type::SMALLINT:
                    $method = 'smallInteger';
                    break;
                case Type::BIGINT:
                    $method = 'bigInteger';
                    break;
                case Type::STRING:
                    $attributes[] = $column->getLength();
                    $method       = 'string';
                    break;
                case Type::GUID:
                case Type::TEXT:
                    $method = 'text';
                    break;
                case Type::FLOAT:
                    $method = 'float';
                    break;
                case Type::DECIMAL:
                    $attributes[] = $column->getPrecision();
                    $attributes[] = $column->getScale();
                    $method       = 'decimal';
                    break;
                case Type::BOOLEAN:
                    $method = 'boolean';
                    break;
                case Type::DATETIME:
                case Type::DATETIMETZ:
                    $method = 'dateTime';
                    break;
                case Type::DATE:
                    $method = 'date';
                    break;
                case Type::TIME:
                    $method = 'time';
                    break;
                case Type::BINARY:
                case Type::BLOB:
                    $method = 'binary';
                    break;
                case Type::JSON_ARRAY:
                    $method = 'json';
                    break;
                default:
                    throw new DbExporterException('Not supported database column type' . $type);
                    break;
            }

            $source .= '$table->' . $method . '(' . implode(', ', $attributes) . ')';
            if ($column->getUnsigned()) {
                $source .= "\n" . '      ->unsigned()';
            }
            if (!$column->getNotnull()) {
                $source .= "\n" . '      ->nullable()';
            }
            if ($column->getDefault() || $column->getDefault() === null && !$column->getNotnull()) {
                $source .= "\n" . '      ->default(' . var_export($column->getDefault(), true) . ')';
            }
            $source .= ';' . "\n";
        }

        return trim($source);
    }
43935
public function render()
    {
        $columns = $this->options[self::GRID_PARAM_COLUMNS];

        if ($this->hasAtLeastOneFilter()) {
            $head = $this->createTableHeader(array(
                $this->createTopHeadingRow($columns),
                $this->createBottomHeadingRow($columns)
            ));
        } else {
            $head = $this->createTableHeader(array(
                $this->createTopHeadingRow($columns)
            ));
        }

        $body = $this->createTableBody($this->createBodyRows($columns, $this->data));

        return $this->createTable(array($head, $body))
                    ->render();
    }
814166
public function renderCellContent($column, $index, $columnIndex = null)
    {
        $id = $column->getElementId($index);
        $name = $column->getElementName($index);

        /**
         * This class inherits iconMap from BaseRenderer
         * If the input to be rendered is a drag column, we give it the appropriate icon class
         * via the $options array
         */
        $options = ['id' => $id];
        if (substr($id, -4) === 'drag') {
            $options = ArrayHelper::merge($options, ['class' => $this->iconMap['drag-handle']]);
        }
        $input = $column->renderInput($name, $options, [
            'id' => $id,
            'name' => $name,
            'indexPlaceholder' => $this->getIndexPlaceholder(),
            'index' => $index,
            'columnIndex' => $columnIndex,
            'context' => $this->context,
        ]);

        if ($column->isHiddenInput()) {
            return $input;
        }

        $layoutConfig = array_merge([
            'offsetClass' => $this->isBootstrapTheme() ? 'col-sm-offset-3' : '',
            'labelClass' => $this->isBootstrapTheme() ? 'col-sm-3' : '',
            'wrapperClass' => $this->isBootstrapTheme() ? 'col-sm-6' : '',
            'errorClass' => $this->isBootstrapTheme() ? 'col-sm-offset-3 col-sm-6' : '',
        ], $this->layoutConfig);

        Html::addCssClass($column->errorOptions, $layoutConfig['errorClass']);

        $hasError = false;
        $error = '';

        if ($index !== null) {
            $error = $column->getFirstError($index);
            $hasError = !empty($error);
        }

        $wrapperOptions = [];

        if ($hasError) {
            Html::addCssClass($wrapperOptions, 'has-error');
        }

        Html::addCssClass($wrapperOptions, $layoutConfig['wrapperClass']);

        $options = [
            'class' => "field-$id list-cell__$column->name" . ($hasError ? ' has-error' : '')
        ];

        if ($this->isBootstrapTheme()) {
            Html::addCssClass($options, 'form-group');
        }

        if (is_callable($column->columnOptions)) {
            $columnOptions = call_user_func($column->columnOptions, $column->getModel(), $index, $this->context);
        } else {
            $columnOptions = $column->columnOptions;
        }

        $options = array_merge_recursive($options, $columnOptions);

        $content = Html::beginTag('div', $options);

        if (empty($column->title)) {
            Html::addCssClass($wrapperOptions, $layoutConfig['offsetClass']);
        } else {
            $labelOptions = ['class' => $layoutConfig['labelClass']];
            if ($this->isBootstrapTheme()) {
                Html::addCssClass($labelOptions, 'control-label');
            }

            $content .= Html::label($column->title, $id, $labelOptions);
        }

        $content .= Html::tag('div', $input, $wrapperOptions);

        // first line
        if ($columnIndex == 0) {
            if ($this->max !== $this->min) {
                $content .= $this->renderActionColumn($index);
            }
            if ($this->cloneButton) {
                $content .= $this->renderCloneColumn();
            }
        }

        if ($column->enableError) {
            $content .= "\n" . $column->renderError($error);
        }

        $content .= Html::endTag('div');

        return $content;
    }
926985
public function getAttributeNameForColumn($columnName)
    {
        if (!empty($this->mappings)) {
            if (isset($this->mappings[$columnName])) {
                return $this->mappings[$columnName];
            }
        }

        return $columnName;
    }
1304109
public function renderFooter()
    {
        if (!$this->isAddButtonPositionFooter()) {
            return '';
        }

        $columnsCount = 0;
        foreach ($this->columns as $column) {
            if (!$column->isHiddenInput()) {
                $columnsCount++;
            }
        }

        if ($this->cloneButton) {
            $columnsCount++;
        }

        $cells = [];
        $cells[] = Html::tag('td', '&nbsp;', ['colspan' => $columnsCount]);
        $cells[] = Html::tag('td', $this->renderAddButton(), [
            'class' => 'list-cell__button'
        ]);

        return Html::tag('tfoot', Html::tag('tr', implode("\n", $cells)));
    }
580351
private function renderHeaderCell($column)
    {
        if ($column->isHiddenInput()) {
            return null;
        }

        $options = $column->headerOptions;
        Html::addCssClass($options, 'list-cell__' . $column->name);

        return Html::tag('th', $column->title, $options);
    }
277204
public function getDataRowHTML()
    {
        $output = [];
        foreach ($this->columns as $name => $column) {

            // If multiple formatters are defined, use the first for the header cell

            if (!is_int($name)) {
                $field = $this->model->getElement($name);
            } else {
                $field = null;
            }

            if (!is_array($column)) {
                $column = [$column];
            }

            // we need to smartly wrap things up
            $cell = null;
            $cnt = count($column);
            $td_attr = [];
            foreach ($column as $c) {
                if (--$cnt) {
                    $html = $c->getDataCellTemplate($field);
                    $td_attr = $c->getTagAttributes('body', $td_attr);
                } else {
                    // Last formatter, ask it to give us whole rendering
                    $html = $c->getDataCellHTML($field, $td_attr);
                }

                if ($cell) {
                    if ($name) {
                        // if name is set, we can wrap things
                        $cell = str_replace('{$'.$name.'}', $cell, $html);
                    } else {
                        $cell = $cell.' '.$html;
                    }
                } else {
                    $cell = $html;
                }
            }

            $output[] = $cell;
        }

        return implode('', $output);
    }
298368
protected function formatName($column)
    {
        if (is_string($column)) {
            $name = explode('.', $column);

            if (1 === count($name)) {
                return $name[0];
            }

            $html = array_shift($name);
            foreach ($name as $piece) {
                $html .= "[$piece]";
            }

            return $html;
        }

        if (is_array($this->column)) {
            $names = [];
            foreach ($this->column as $key => $name) {
                $names[$key] = $this->formatName($name);
            }

            return $names;
        }

        return '';
    }
667356
protected function render($template, $data = [])
    {
        $view = new View();
        $view->type(View::VIEW_TYPE_CELL);
        $view->set($data);
        $className = get_class($this);
        $namePrefix = '\View\Cell\\';
        $name = substr($className, strpos($className, $namePrefix) + strlen($namePrefix));
        $view->context(str_replace('\\', DIRECTORY_SEPARATOR, $name));
        return $view->render($template);
    }
1130681
public function getColumn($columnName)
    {
        return isset($this->_columns[$columnName]) ? $this->_columns[$columnName] : null;
    }
481834
function td($rowName, $colName, $content) {
    $this->cellContents[$rowName][$colName] = $content;
    return $this;
  }