You are here

public function Twig_Compiler::string in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Compiler.php \Twig_Compiler::string()

Adds a quoted string to the compiled code.

Parameters

string $value The string:

Return value

Twig_Compiler The current compiler instance

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

File

vendor/twig/twig/lib/Twig/Compiler.php, line 151

Class

Twig_Compiler
Compiles a node to PHP code.

Code

public function string($value) {
  $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\"));
  return $this;
}