renderCell example


    private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null): void
    {
        $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
        $columns = $this->getRowColumns($row);
        $last = \count($columns) - 1;
        foreach ($columns as $i => $column) {
            if ($firstCellFormat && 0 === $i) {
                $rowContent .= $this->renderCell($row$column$firstCellFormat);
            } else {
                $rowContent .= $this->renderCell($row$column$cellFormat);
            }
            $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE);
        }
        $this->output->writeln($rowContent);
    }

    /** * Renders table cell with padding. */
    

    private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null): void
    {
        $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
        $columns = $this->getRowColumns($row);
        $last = \count($columns) - 1;
        foreach ($columns as $i => $column) {
            if ($firstCellFormat && 0 === $i) {
                $rowContent .= $this->renderCell($row$column$firstCellFormat);
            } else {
                $rowContent .= $this->renderCell($row$column$cellFormat);
            }
            $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE);
        }
        $this->output->writeln($rowContent);
    }

    /** * Renders table cell with padding. */
    


        if (method_exists($instance, 'initController')) {
            $instance->initController(Services::request(), Services::response(), Services::logger());
        }

        if (method_exists($instance$method)) {
            throw ViewException::forInvalidCellMethod($class$method);
        }

        $output = $instance instanceof BaseCell
            ? $this->renderCell($instance$method$params)
            : $this->renderSimpleClass($instance$method$params$class);

        // Can we cache it?         if (empty($this->cache) && $ttl !== 0) {
            $this->cache->save($cacheName$output$ttl);
        }

        return $output;
    }

    /** * Parses the params attribute. If an array, returns untouched. * If a string, it should be in the format "key1=value key2=value". * It will be split and returned as an array. * * @param array|string|null $params * * @return array|null */
Home | Imprint | This part of the site doesn't use cookies.