Generate html code for the passed row.

@param array $row Row data.
@param string $classname classes to add.

@return string $html html code for the row passed.
342907
public function get_row_html($row, $classname = '') {
        static $suppress_lastrow = NULL;
        $rowclasses = array();

        if ($classname) {
            $rowclasses[] = $classname;
        }

        $rowid = $this->uniqueid . '_r' . $this->currentrow;
        $html = '';

        $html .= html_writer::start_tag('tr', array('class' => implode(' ', $rowclasses), 'id' => $rowid));

        // If we have a separator, print it
        if ($row === NULL) {
            $colcount = count($this->columns);
            $html .= html_writer::tag('td', html_writer::tag('div', '',
                    array('class' => 'tabledivider')), array('colspan' => $colcount));

        } else {
            $colbyindex = array_flip($this->columns);
            foreach ($row as $index => $data) {
                $column = $colbyindex[$index];

                $attributes = [
                    'class' => "cell c{$index}" . $this->column_class[$column],
                    'id' => "{$rowid}_c{$index}",
                    'style' => $this->make_styles_string($this->column_style[$column]),
                ];

                $celltype = 'td';
                if ($this->headercolumn && $column == $this->headercolumn) {
                    $celltype = 'th';
                    $attributes['scope'] = 'row';
                }

                if (empty($this->prefs['collapse'][$column])) {
                    if ($this->column_suppress[$column] && $suppress_lastrow !== NULL && $suppress_lastrow[$index] === $data) {
                        $content = '&nbsp;';
                    } else {
                        $content = $data;
                    }
                } else {
                    $content = '&nbsp;';
                }

                $html .= html_writer::tag($celltype, $content, $attributes);
            }
        }

        $html .= html_writer::end_tag('tr');

        $suppress_enabled = array_sum($this->column_suppress);
        if ($suppress_enabled) {
            $suppress_lastrow = $row;
        }
        $this->currentrow++;
        return $html;
    }
1233313
protected function renderDataCellContent($row, $data)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        $labelType = $this->active || $am->hasParent($this->itemName, $data['name']) || $am->hasChild(
            $this->itemName,
            $data['name']
        ) ? 'info' : '';

        /* @var $controller AuthItemController */
        $controller = $this->grid->getController();

        echo TbHtml::labelTb(
            $controller->getItemTypeText($data['item']->type),
            array(
                'color' => $labelType,
            )
        );
    }
1287988
protected static function _renderImage($src, $className, array $attributes = array())
        {
            if (is_array($attributes['class'])) {
                $attributes['class'][] = $className;
            } else {
                $attributes['class'] .= ' ' . $className;
            }

            return sprintf('<img src="%s"%s />', Html::escape($src), Html::attributes($attributes));
        }
441633
protected function renderDataCellContent($row, $data)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        /* @var $controller AssignmentController */
        $controller = $this->grid->getController();

        $assignments = $am->getAuthAssignments($data->{$this->idColumn});
        $permissions = $am->getItemsPermissions(array_keys($assignments));
        foreach ($permissions as $itemPermission) {
            echo $itemPermission['item']->description;
            echo ' <small>' . $controller->getItemTypeText($itemPermission['item']->type, false) . '</small><br />';
        }
    }
706840
public function renderRowDefinition(PHPRtfLite_Table_Row $row)
    {
        $rowIndex = $row->getRowIndex();
        $stream = $this->getRtf()->getWriter();
        $stream->write('\trowd');

        if ($this->_alignment) {
            switch ($this->_alignment) {
                case self::ALIGN_CENTER:
                    $stream->write('\trqc');
                    break;

                case self::ALIGN_RIGHT:
                    $stream->write('\trqr');
                    break;

                default:
                    $stream->write('\trql');
                    break;
            }
        }

        $rowHeight = $row->getHeight();
        if ($rowHeight) {
            $stream->write('\trrh' . PHPRtfLite_Unit::getUnitInTwips($rowHeight));
        }

        if ($this->isPreventPageBreak()) {
            $stream->write('\trkeep ');
        }

        if ($this->isFirstRowHeader() && $rowIndex == 1) {
            $stream->write('\trhdr ');
        }

        if ($this->getLeftPosition() != '') {
            $stream->write('\trleft' . PHPRtfLite_Unit::getUnitInTwips($this->getLeftPosition()) . ' ');
        }

        $width = 0;
        foreach ($this->getColumns() as $columnIndex => $column) {
            $cell = $this->getCell($rowIndex, $columnIndex + 1);

            // render cell definition
            if (!$cell->isHorizontalMerged()) {
                $cell->renderDefinition();

                // cell width
                $width += PHPRtfLite_Unit::getUnitInTwips($cell->getWidth());
                $stream->write('\cellx' . $width);
            }
        }
    }
377418
public function render(Row $row)
	{
		if (!$this->shouldBeRendered($row)) {
			return null;
		}

		try {
			// Renderer function may be used
			return $this->useRenderer($row);
		} catch (DataGridColumnRendererException $e) {
			// Do not use renderer
		}

		$link = $this->createLink(
			$this->grid,
			$this->href,
			$this->getItemParams($row, $this->params) + $this->parameters
		);

		$a = Html::el('a')->href($link);

		$this->tryAddIcon($a, $this->getIcon($row), $this->getName());

		if (!empty($this->data_attributes)) {
			foreach ($this->data_attributes as $key => $value) {
				$a->data($key, $value);
			}
		}

		if (!empty($this->attributes)) {
			$a->addAttributes($this->attributes);
		}

		$a->addText($this->translate($this->getName()));

		if ($this->title) {
			$a->title($this->translate($this->getTitle($row)));
		}

		if ($this->class) {
			$a->class($this->getClass($row));
		}

		if ($confirm = $this->getConfirm($row)) {
			$a->data(static::$data_confirm_attribute_name, $confirm);
		}

		if ($this->open_in_new_tab) {
			$a->addAttributes(['target' => '_blank']);
		}

		return $a;
	}
907696
public function row($vars = '', $cells = '')
    {
        $html = $this->wrapUp('row')."\n\t";
        $this->body = true;
        $this->vars = (!empty($cells)) ? $this->values($cells) : array();

        return $html.$this->page->tag('tr', $this->values($vars));
    }
211991
protected function generateClassName($tableName)
    {
        if (isset($this->_classNames[$tableName])) {
            return $this->_classNames[$tableName];
        }

        if (($pos = strrpos($tableName, '.')) !== false) {
            $tableName = substr($tableName, $pos + 1);
        }

        $db = $this->getDbConnection();
        $patterns = [];
        $patterns[] = "/^{$db->tablePrefix}(.*?)$/";
        $patterns[] = "/^(.*?){$db->tablePrefix}$/";
        if (strpos($this->tableName, '*') !== false) {
            $pattern = $this->tableName;
            if (($pos = strrpos($pattern, '.')) !== false) {
                $pattern = substr($pattern, $pos + 1);
            }
            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
        }
        $className = $tableName;
        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $tableName, $matches)) {
                $className = $matches[1];
                break;
            }
        }

        return $this->_classNames[$tableName] = Inflector::id2camel($className, '_');
    }
835031
protected function _generateRow($row = null)
    {
        static $fp = false;

        if (empty($row)) {
            return '';
        }

        if ($fp === false) {
            $fp = fopen('php://temp', 'r+');

            if ($this->viewVars['_setSeparator']) {
                fwrite($fp, "sep=" . $this->viewVars['_delimiter'] . "\n");
            }
        } else {
            ftruncate($fp, 0);
        }

        if ($this->viewVars['_null'] !== '') {
            foreach ($row as &$field) {
                if ($field === null) {
                    $field = $this->viewVars['_null'];
                }
            }
        }

        $delimiter = $this->viewVars['_delimiter'];
        $enclosure = $this->viewVars['_enclosure'];
        $newline = $this->viewVars['_newline'];

        $row = str_replace(["\r\n", "\n", "\r"], $newline, $row);
        if ($enclosure === '') {
            // fputcsv does not supports empty enclosure
            if (fputs($fp, implode($delimiter, $row) . "\n") === false) {
                return false;
            }
        } else {
            if (fputcsv($fp, $row, $delimiter, $enclosure) === false) {
                return false;
            }
        }

        rewind($fp);

        $csv = '';
        while (($buffer = fgets($fp, 4096)) !== false) {
            $csv .= $buffer;
        }

        $eol = $this->viewVars['_eol'];
        if ($eol !== "\n") {
            $csv = str_replace("\n", $eol, $csv);
        }

        $dataEncoding = $this->viewVars['_dataEncoding'];
        $csvEncoding = $this->viewVars['_csvEncoding'];
        if ($dataEncoding !== $csvEncoding) {
            $extension = $this->viewVars['_extension'];
            if ($extension === self::EXTENSION_ICONV) {
                $csv = iconv($dataEncoding, $csvEncoding, $csv);
            } elseif ($extension === self::EXTENSION_MBSTRING) {
                $csv = mb_convert_encoding($csv, $csvEncoding, $dataEncoding);
            }
        }

        //bom must be added after encoding
        if ($this->viewVars['_bom'] && $this->isFirstBom) {
            $csv = $this->getBom($this->viewVars['_csvEncoding']) . $csv;
            $this->isFirstBom = false;
        }

        return $csv;
    }
736238
protected function generateBoxLabel($row)
    {
        // Generate the title
        $html = '<span class="title">'.$row->getAdminTitleHtmlAttribute().'</span>';

        // Add link to edit
        $url = '/'.Config::get('decoy.core.dir').'/'.Str::snake($this->name, '-')
            .'/'.$row->getKey().'/edit';
        if (app('decoy.user')->can('update', $url)) {
            $html .= '<a href="'.$url.'"><span class="glyphicon glyphicon-pencil edit"></span></a>';
        }

        // The str_replace fixes Former's auto conversion of underscores into spaces.
        $html = str_replace('_', '&#95;', $html);

        return $html;
    }
351595
protected function compileTableFooter()
    {
        $footer = [];
        foreach ($this->collection->all() as $row) {
            if (is_array($row->footer)) {
                $footerAttr = $this->html->attributes(array_only($row->footer,
                    ['class', 'id', 'title', 'width', 'style', 'data-class', 'data-hide']));
                $title = isset($row->footer['title']) ? $row->footer['title'] : '';
                $footer[] = '<th ' . $footerAttr . '>' . $title . '</th>';
            } else {
                $footer[] = '<th>' . $row->footer . '</th>';
            }
        }

        return $footer;
    }
1084749
public function render(array $columnNames, array $rows): string
	{
		if(!$this->isValidInput($columnNames, $rows))
		{
			throw new RuntimeException('The number of cells in each row must match the number of columns.');
		}

		$columnWidths = $this->getColumnWidths($columnNames, $rows);

		// Build table header

		$table = $this->buildRowSeparator($columnWidths);

		$table .= $this->buildTableRow($columnNames, $columnWidths);

		$table .= $this->buildRowSeparator($columnWidths);

		// Add table rows

		foreach($rows as $row)
		{
			$table .= $this->buildTableRow($row, $columnWidths);
		}

		// Add bottom border

		$table .= $this->buildRowSeparator($columnWidths);

		// Return table

		return $table;
	}
211190
public function render(\Magento\Framework\DataObject $row)
    {
        $url = $this->getUrl('customer/mail/edit', array('id' => $row->getId()));
        return "<a href='{$url}' target='_blank'>View</a>";
    }
236638
public function container(Column\Container $column, array $row) {

        $html = '';
        foreach($column->getColumns() as $c) {
            /** @var Column\Column $c */
            $html .= $c->render($row) . PHP_EOL;
        }

        return $this->post($html, $column, $row);
    }
1362104
public function decorateActions($row = null)
    {
        if (empty($this->tableActions)) {
            return '';
        }
        $html    = app('html');
        $section = $html->create('div', $html->raw(implode('', $this->tableActions->toArray())), ['class' => 'mass-actions-menu', 'data-id' => $row->id ? $row->id : ''])->get();

        return '<i class="zmdi zmdi-more"></i>' . app('html')->raw($section)->get();
    }
172178
protected function renderDataCellContent($row, $data)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        $linkCssClass = $this->active || $am->hasParent($this->itemName, $data['name']) || $am->hasChild(
            $this->itemName,
            $data['name']
        ) ? 'active' : 'disabled';

        /* @var $controller AuthItemController */
        $controller = $this->grid->getController();

        echo CHtml::link(
            $data['item']->description,
            array('/auth/' . $controller->getItemControllerId($data['item']->type) . '/view', 'name' => $data['name']),
            array('class' => $linkCssClass)
        );
    }
1207495
protected function renderDataCellContent($row, $data)
    {
        $checked = CHtml::value($data, $this->name);
        $toggleOptions = $this->toggleOptions;
        $toggleOptions['icon'] = $checked === null
            ? $this->emptyIcon
            : ($checked
                ? $this->checkedIcon
                : $this->uncheckedIcon);

        $toggleOptions['url'] = isset($toggleOptions['url'])
            ? $this->evaluateExpression($toggleOptions['url'], array('data' => $data, 'row' => $row))
            : '#';

        if (!$this->displayText) {
            $htmlOptions = TbArray::getValue('htmlOptions', $this->toggleOptions, array());
            $htmlOptions['title'] = $this->getButtonLabel($checked);
            $htmlOptions['rel'] = 'tooltip';
            echo CHtml::link(TbHtml::icon($toggleOptions['icon']), $toggleOptions['url'], $htmlOptions);
        } else {
            echo TbHtml::button($this->getButtonLabel($checked), $toggleOptions);
        }
    }