Packages

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

Classes

  • LatteFilter
  • MacroNode
  • MacroTokenizer
  • Parser
  • PhpWriter

Interfaces

  • IMacro

Exceptions

  • LatteException
  • Overview
  • Package
  • Class
  • Tree

Class Parser

Compile-time filter Latte.

Object
Extended by Parser
Package: Nette\Latte
Author: David Grudl
Located at Latte/Parser.php
Methods summary
public
# __construct( )
public Parser
# addMacro( $name, IMacro $macro )

Adds new macro

Adds new macro

Parameters

$name
$macro

Returns

Parser
provides a fluent interface
public string
# parse( string $s )

Process all {macros} and <tags/>.

Process all {macros} and <tags/>.

Parameters

$s
string

Returns

string
public integer
# getLine( )

Returns current line number.

Returns current line number.

Returns

integer
public LatteFilter
# setDelimiters( string $left, string $right )

Changes macro delimiters.

Changes macro delimiters.

Parameters

$left
string
left regular expression
$right
string
right regular expression

Returns

LatteFilter
provides a fluent interface
public
# writeMacro( string $name, string $args = NULL, string $modifiers = NULL, boolean $isRightmost = FALSE )

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

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

Parameters

$name
string
$args
string
$modifiers
string
$isRightmost
boolean
public
# writeAttrsMacro( string $code, array $attrs, boolean $closing )

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

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

Parameters

$code
string
$attrs
array
$closing
boolean
public array(MacroNode,
# expandMacro( string $name, string $args, string $modifiers = NULL )

Expands macro and returns node & code.

Expands macro and returns node & code.

Parameters

$name
string
$args
string
$modifiers
string

Returns

array(MacroNode,
string)
public array
# parseMacro( string $macro )

Parses macro to name, arguments a modifiers parts.

Parses macro to name, arguments a modifiers parts.

Parameters

$macro
string
{name arguments | modifiers}

Returns

array
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string RE_STRING '\'(?:\\\\.|[^\'\\\\])*\'|"(?:\\\\.|[^"\\\\])*"'
#
string N_PREFIX 'n:'
#
string CONTEXT_TEXT 'text'
#
string CONTEXT_CDATA 'cdata'
#
string CONTEXT_TAG 'tag'
#
string CONTEXT_ATTRIBUTE 'attribute'
#
string CONTEXT_NONE 'none'
#
string CONTEXT_COMMENT 'comment'
#
Properties summary
public array $context
#
public string $templateId
#
Nette Framework 2.0beta1 (for PHP 5.2) API API documentation generated by ApiGen 2.3.0