Namespaces

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

Classes

  • Engine
  • MacroNode
  • MacroTokenizer
  • Parser
  • PhpWriter

Interfaces

  • IMacro

Exceptions

  • ParseException
  • Overview
  • Namespace
  • 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:  */
11: 
12: namespace Nette\Latte;
13: 
14: use Nette;
15: 
16: 
17: 
18: /**
19:  * Macro element node.
20:  *
21:  * @author     David Grudl
22:  */
23: class MacroNode extends Nette\Object
24: {
25:     /** @var IMacro */
26:     public $macro;
27: 
28:     /** @var string */
29:     public $name;
30: 
31:     /** @var bool */
32:     public $isEmpty = FALSE;
33: 
34:     /** @var string  raw arguments */
35:     public $args;
36: 
37:     /** @var string  raw modifier */
38:     public $modifiers;
39: 
40:     /** @var bool */
41:     public $closing = FALSE;
42: 
43:     /** @var MacroTokenizer */
44:     public $tokenizer;
45: 
46:     /** @var int @internal */
47:     public $offset;
48: 
49:     /** @var MacroNode */
50:     public $parentNode;
51: 
52:     /** @var string */
53:     public $content;
54: 
55:     /** @var stdClass  user data */
56:     public $data;
57: 
58: 
59: 
60:     public function __construct(IMacro $macro, $name, $args = NULL, $modifiers = NULL, MacroNode $parentNode = NULL)
61:     {
62:         $this->macro = $macro;
63:         $this->name = (string) $name;
64:         $this->modifiers = (string) $modifiers;
65:         $this->parentNode = $parentNode;
66:         $this->tokenizer = new MacroTokenizer($this->args);
67:         $this->data = new \stdClass;
68:         $this->setArgs($args);
69:     }
70: 
71: 
72: 
73:     public function setArgs($args)
74:     {
75:         $this->args = (string) $args;
76:         $this->tokenizer->tokenize($this->args);
77:     }
78: 
79: 
80: 
81:     public function close($content)
82:     {
83:         $this->closing = TRUE;
84:         $this->content = $content;
85:         return $this->macro->nodeClosed($this);
86:     }
87: 
88: }
89: 
Nette Framework 2.0beta1 API API documentation generated by ApiGen 2.3.0