Packages

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

Classes

  • NLatteCompiler
  • NLatteFilter
  • NLatteToken
  • NMacroNode
  • NMacroTokenizer
  • NParser
  • NPhpWriter

Interfaces

  • IMacro

Exceptions

  • NLatteException
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework.
 5:  *
 6:  * Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
 7:  *
 8:  * This source file is subject to the "Nette license", and/or
 9:  * GPL license. For more information please see http://nette.org
10:  * @package Nette\Latte
11:  */
12: 
13: 
14: 
15: /**
16:  * Macro element node.
17:  *
18:  * @author     David Grudl
19:  * @package Nette\Latte
20:  */
21: class NMacroNode extends NObject
22: {
23:     /** @var IMacro */
24:     public $macro;
25: 
26:     /** @var string */
27:     public $name;
28: 
29:     /** @var bool */
30:     public $isEmpty = FALSE;
31: 
32:     /** @var string  raw arguments */
33:     public $args;
34: 
35:     /** @var string  raw modifier */
36:     public $modifiers;
37: 
38:     /** @var bool */
39:     public $closing = FALSE;
40: 
41:     /** @var NMacroTokenizer */
42:     public $tokenizer;
43: 
44:     /** @var int @internal */
45:     public $offset;
46: 
47:     /** @var NMacroNode */
48:     public $parentNode;
49: 
50:     /** @var string */
51:     public $content;
52: 
53:     /** @var stdClass  user data */
54:     public $data;
55: 
56:     /** @var NHtmlNode  for n:attr macros */
57:     public $htmlNode;
58: 
59: 
60: 
61:     public function __construct(IMacro $macro, $name, $args = NULL, $modifiers = NULL, NMacroNode $parentNode = NULL, NHtmlNode $htmlNode = NULL)
62:     {
63:         $this->macro = $macro;
64:         $this->name = (string) $name;
65:         $this->modifiers = (string) $modifiers;
66:         $this->parentNode = $parentNode;
67:         $this->htmlNode = $htmlNode;
68:         $this->tokenizer = new NMacroTokenizer($this->args);
69:         $this->data = new stdClass;
70:         $this->setArgs($args);
71:     }
72: 
73: 
74: 
75:     public function setArgs($args)
76:     {
77:         $this->args = (string) $args;
78:         $this->tokenizer->tokenize($this->args);
79:     }
80: 
81: 
82: 
83:     public function close($content)
84:     {
85:         $this->closing = TRUE;
86:         $this->content = $content;
87:         return $this->macro->nodeClosed($this);
88:     }
89: 
90: }
91: 
Nette Framework 2.0beta2 (for PHP 5.2) API API documentation generated by ApiGen 2.3.0