Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Compiler
  • Engine
  • HtmlNode
  • MacroNode
  • MacroTokens
  • Object
  • Parser
  • PhpWriter
  • Token

Interfaces

  • ILoader
  • IMacro

Exceptions

  • CompileException
  • RegexpException
  • RuntimeException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class PhpWriter

PHP code generator helpers.

Latte\Object
Extended by Latte\PhpWriter
Namespace: Latte
Located at Latte/PhpWriter.php
Methods summary
public static
# using( Latte\MacroNode $node, Latte\Compiler $compiler = NULL )
public
# __construct( Latte\MacroTokens $tokens, $modifiers = NULL, Latte\Compiler $compiler = NULL )
public string
# write( string $mask )

Expands %node.word, %node.array, %node.args, %escape(), %modify(), %var, %raw, %word in code.

Expands %node.word, %node.array, %node.args, %escape(), %modify(), %var, %raw, %word in code.

Parameters

$mask

Returns

string
string
public string
# formatModifiers( string $var )

Formats modifiers calling.

Formats modifiers calling.

Parameters

$var

Returns

string
string
public string
# formatArgs( Latte\MacroTokens $tokens = NULL )

Formats macro arguments to PHP code. (It advances tokenizer to the end as a side effect.)

Formats macro arguments to PHP code. (It advances tokenizer to the end as a side effect.)

Returns

string
string
public string
# formatArray( Latte\MacroTokens $tokens = NULL )

Formats macro arguments to PHP array. (It advances tokenizer to the end as a side effect.)

Formats macro arguments to PHP array. (It advances tokenizer to the end as a side effect.)

Returns

string
string
public string
# formatWord( string $s )

Formats parameter to PHP string.

Formats parameter to PHP string.

Parameters

$s

Returns

string
string
public Latte\MacroTokens
# preprocess( Latte\MacroTokens $tokens = NULL )

Preprocessor for tokens. (It advances tokenizer to the end as a side effect.)

Preprocessor for tokens. (It advances tokenizer to the end as a side effect.)

Returns

Latte\MacroTokens
MacroTokens
public Latte\MacroTokens
# removeCommentsFilter( Latte\MacroTokens $tokens )

Removes PHP comments.

Removes PHP comments.

Returns

Latte\MacroTokens
MacroTokens
public Latte\MacroTokens
# shortTernaryFilter( Latte\MacroTokens $tokens )

Simplified ternary expressions without third part.

Simplified ternary expressions without third part.

Returns

Latte\MacroTokens
MacroTokens
public Latte\MacroTokens
# shortArraysFilter( Latte\MacroTokens $tokens )

Simplified array syntax [...]

Simplified array syntax [...]

Returns

Latte\MacroTokens
MacroTokens
public Latte\MacroTokens
# expandFilter( Latte\MacroTokens $tokens )

Pseudocast (expand).

Pseudocast (expand).

Returns

Latte\MacroTokens
MacroTokens
public Latte\MacroTokens
# quoteFilter( Latte\MacroTokens $tokens )

Quotes symbols to strings.

Quotes symbols to strings.

Returns

Latte\MacroTokens
MacroTokens
public Latte\MacroTokens
# modifiersFilter( Latte\MacroTokens $tokens, string $var )

Formats modifiers calling.

Formats modifiers calling.

Parameters

$tokens
$var

Returns

Latte\MacroTokens
MacroTokens

Throws

Latte\CompileException
CompileException
public Latte\MacroTokens
# escapeFilter( Latte\MacroTokens $tokens )

Escapes expression in tokens.

Escapes expression in tokens.

Returns

Latte\MacroTokens
MacroTokens
Methods inherited from Latte\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset()
Nette 2.3-20161221 API API documentation generated by ApiGen 2.8.0