Namespaces

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

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
Author: David Grudl
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
string

Returns

string
public string
# formatModifiers( string $var )

Formats modifiers calling.

Formats modifiers calling.

Parameters

$var
string

Returns

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
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
public string
# formatWord( string $s )

Formats parameter to PHP string.

Formats parameter to PHP string.

Parameters

$s
string

Returns

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
public Latte\MacroTokens
# removeCommentsFilter( Latte\MacroTokens $tokens )

Removes PHP comments.

Removes PHP comments.

Returns

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

Simplified ternary expressions without third part.

Simplified ternary expressions without third part.

Returns

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

Simplified array syntax [...]

Simplified array syntax [...]

Returns

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

Pseudocast (expand).

Pseudocast (expand).

Returns

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

Quotes symbols to strings.

Quotes symbols to strings.

Returns

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

Formats modifiers calling.

Formats modifiers calling.

Parameters

$tokens
Latte\MacroTokens
$var
string

Returns

Latte\MacroTokens

Throws

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

Escapes expression in tokens.

Escapes expression in tokens.

Returns

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