Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • none

Classes

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

Interfaces

  • IMacro

Exceptions

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

Class PhpWriter

PHP code generator helpers.

Nette\Object
Extended by Nette\Latte\PhpWriter
Namespace: Nette\Latte
Author: David Grudl
Located at Latte/PhpWriter.php
Methods summary
public static
# using( Nette\Latte\MacroNode $node, Nette\Latte\Compiler $compiler = NULL )
public
# __construct( Nette\Latte\MacroTokens $tokens, $modifiers = NULL, Nette\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( Nette\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( Nette\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 Nette\Latte\MacroTokens
# preprocess( Nette\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

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

Removes PHP comments.

Removes PHP comments.

Returns

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

Simplified ternary expressions without third part.

Simplified ternary expressions without third part.

Returns

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

Simplified array syntax [...]

Simplified array syntax [...]

Returns

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

Pseudocast (expand).

Pseudocast (expand).

Returns

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

Quotes symbols to strings.

Quotes symbols to strings.

Returns

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

Formats modifiers calling.

Formats modifiers calling.

Parameters

$tokens
Nette\Latte\MacroTokens
$var
string

Returns

Nette\Latte\MacroTokens

Throws

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

Escapes expression in tokens.

Escapes expression in tokens.

Returns

Nette\Latte\MacroTokens
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Magic properties inherited from Nette\Object
$reflection
Nette 2.1 API documentation generated by ApiGen 2.8.0