Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Renderer.php

function Renderer::setFormatter

Sets the formatter to use for the rendering

Parameters

Formatter\Base $formatter Formatter:

Return value

$this

File

vendor/mck89/peast/lib/Peast/Renderer.php, line 64

Class

Renderer
Nodes renderer class

Namespace

Peast

Code

public function setFormatter(Formatter\Base $formatter) {
    $this->formatter = $formatter;
    $this->renderOpts = (object) array(
        "nl" => $this->formatter
            ->getNewLine(),
        "ind" => $this->formatter
            ->getIndentation(),
        "nlbc" => $this->formatter
            ->getNewLineBeforeCurlyBracket(),
        "sao" => $this->formatter
            ->getSpacesAroundOperator() ? " " : "",
        "sirb" => $this->formatter
            ->getSpacesInsideRoundBrackets() ? " " : "",
        "awb" => $this->formatter
            ->getAlwaysWrapBlocks(),
        "com" => $this->formatter
            ->getRenderComments(),
        "rci" => $this->formatter
            ->getRecalcCommentsIndent(),
    );
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal