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
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Compiler
  • Engine
  • Helpers
  • HtmlNode
  • MacroNode
  • MacroTokens
  • Parser
  • PhpHelpers
  • PhpWriter
  • Token
  • TokenIterator
  • Tokenizer

Interfaces

  • ILoader
  • IMacro

Traits

  • Strict

Exceptions

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

Class Compiler

Latte compiler.

Latte\Compiler uses Latte\Strict
Namespace: Latte
Located at Latte/Compiler/Compiler.php
Methods summary
public Latte\Compiler
# addMacro( string $name, Latte\IMacro $macro, $flags = null )

Adds new macro with IMacro flags.

Adds new macro with IMacro flags.

Parameters

$name
$macro
$flags

Returns

Latte\Compiler
static
public string
# compile( array $tokens, $className )

Compiles tokens to PHP code.

Compiles tokens to PHP code.

Parameters

$tokens
$className

Returns

string
string
public Latte\Compiler
# setContentType( $type )

Returns

Latte\Compiler
static
public
# getContentType( )

Deprecated

public
# setContext( $context )

Internal

public
# getContext( )

Deprecated

public Latte\MacroNode|null
# getMacroNode( )

Returns

Latte\MacroNode|null
MacroNode|null
public integer|null
# getLine( )

Returns current line number.

Returns current line number.

Returns

integer|null
int|null
public boolean
# isInHead( )

Returns

boolean
bool
public
# addMethod( $name, $body, $arguments = '' )

Adds custom method to template.

Adds custom method to template.

Internal

public array
# getMethods( )

Returns custom methods.

Returns custom methods.

Returns

array
array

Internal

public
# addProperty( $name, $value )

Adds custom property to template.

Adds custom property to template.

Internal

public array
# getProperties( )

Returns custom properites.

Returns custom properites.

Returns

array
array

Internal

public
# expandTokens( $s )

Internal

public Latte\MacroNode
# openMacro( string $name, string $args = null, string $modifiers = null, boolean $isRightmost = false, $nPrefix = null )

Generates code for {macro ...} to the output.

Generates code for {macro ...} to the output.

Parameters

$name
$args
$modifiers
$isRightmost
$nPrefix

Returns

Latte\MacroNode
MacroNode

Internal

public Latte\MacroNode
# closeMacro( string $name, string $args = null, string $modifiers = null, boolean $isRightmost = false, $nPrefix = null )

Generates code for {/macro ...} to the output.

Generates code for {/macro ...} to the output.

Parameters

$name
$args
$modifiers
$isRightmost
$nPrefix

Returns

Latte\MacroNode
MacroNode

Internal

public
# writeAttrsMacro( string $html )

Generates code for macro <tag n:attr> to the output.

Generates code for macro <tag n:attr> to the output.

Parameters

$html
tag

Internal

public Latte\MacroNode
# expandMacro( string $name, string $args, string $modifiers = null, $nPrefix = null )

Expands macro and returns node & code.

Expands macro and returns node & code.

Parameters

$name
$args
$modifiers
$nPrefix

Returns

Latte\MacroNode
MacroNode

Internal

Methods used from Latte\Strict
__call(), __callStatic(), __get(), __isset(), __set(), __unset()
Constants summary
string CONTENT_HTML

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_HTML
string CONTENT_XHTML

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_XHTML
string CONTENT_XML

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_XML
string CONTENT_JS

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_JS
string CONTENT_CSS

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_CSS
string CONTENT_ICAL

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_ICAL
string CONTENT_TEXT

Context-aware escaping content types

Context-aware escaping content types

#Latte\Engine::CONTENT_TEXT
CONTEXT_HTML_TEXT

Internal

Context-aware escaping HTML contexts
#null
string CONTEXT_HTML_TAG

Internal

Context-aware escaping HTML contexts
#'Tag'
string CONTEXT_HTML_ATTRIBUTE

Internal

Context-aware escaping HTML contexts
#'Attr'
string CONTEXT_HTML_ATTRIBUTE_JS

Internal

Context-aware escaping HTML contexts
#'AttrJs'
string CONTEXT_HTML_ATTRIBUTE_CSS

Internal

Context-aware escaping HTML contexts
#'AttrCss'
string CONTEXT_HTML_ATTRIBUTE_URL

Internal

Context-aware escaping HTML contexts
#'AttrUrl'
string CONTEXT_HTML_ATTRIBUTE_UNQUOTED_URL

Internal

Context-aware escaping HTML contexts
#'AttrUnquotedUrl'
string CONTEXT_HTML_COMMENT

Internal

Context-aware escaping HTML contexts
#'Comment'
string CONTEXT_HTML_BOGUS_COMMENT

Internal

Context-aware escaping HTML contexts
#'Bogus'
string CONTEXT_HTML_CSS

Internal

Context-aware escaping HTML contexts
#'Css'
string CONTEXT_HTML_JS

Internal

Context-aware escaping HTML contexts
#'Js'
CONTEXT_XML_TEXT

Internal

Context-aware escaping HTML contexts
#Latte\Compiler::CONTEXT_HTML_TEXT
string CONTEXT_XML_TAG

Internal

Context-aware escaping HTML contexts
#Latte\Compiler::CONTEXT_HTML_TAG
string CONTEXT_XML_ATTRIBUTE

Internal

Context-aware escaping HTML contexts
#Latte\Compiler::CONTEXT_HTML_ATTRIBUTE
string CONTEXT_XML_COMMENT

Internal

Context-aware escaping HTML contexts
#Latte\Compiler::CONTEXT_HTML_COMMENT
string CONTEXT_XML_BOGUS_COMMENT

Internal

Context-aware escaping HTML contexts
#Latte\Compiler::CONTEXT_HTML_BOGUS_COMMENT
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0