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

Breadcrumb

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

function Compiler::string

Adds a quoted string to the compiled code.

Return value

$this

1 call to Compiler::string()
Compiler::repr in vendor/twig/twig/src/Compiler.php
Returns a PHP representation of a given value.

File

vendor/twig/twig/src/Compiler.php, line 144

Class

Compiler
@author Fabien Potencier <fabien@symfony.com>

Namespace

Twig

Code

public function string(string $value) {
    $this->source .= \sprintf('"%s"', addcslashes($value, "\x00\t\"\$\\"));
    return $this;
}
RSS feed
Powered by Drupal