Source for file BaseTemplate.php
Documentation is available at BaseTemplate.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see http://nettephp.com
- 12: *
- 18: */
- 28: /**
- 29: * Template.
- 30: *
- 34: */
- 36: {
- 40: /** @var array of function(BaseTemplate $sender); Occurs before a template is compiled - implement to customize the filters */
- 57: /**
- 58: * Registers callback as template compile-time filter.
- 61: */
- 63: {
- 67: throw new InvalidArgumentException("Filter '$textual' is not " . ($able ? 'callable.' : 'valid PHP callback.'));
- 68: }
- 72: }
- 74: }
- 78: /**
- 79: * Returns all registered compile-time filters.
- 81: */
- 83: {
- 85: }
- 89: /********************* rendering ****************d*g**/
- 93: /**
- 94: * Renders template to output.
- 97: */
- 99: {
- 100: }
- 104: /**
- 105: * Renders template to string.
- 108: */
- 110: {
- 123: }
- 124: }
- 125: }
- 129: /**
- 130: * Applies filters on template content.
- 134: */
- 136: {
- 139: }
- 146: }
- 149: throw new InvalidStateException("Filter $textual: " . $e->getMessage() . ($label ? " (in $label)" : ''), 0, $e);
- 150: }
- 154: }
- 157: }
- 161: /********************* template helpers ****************d*g**/
- 165: /**
- 166: * Registers callback as template run-time helper.
- 170: */
- 172: {
- 176: throw new InvalidArgumentException("Helper handler '$textual' is not " . ($able ? 'callable.' : 'valid PHP callback.'));
- 177: }
- 179: }
- 183: /**
- 184: * Registers callback as template run-time helpers loader.
- 187: */
- 189: {
- 193: throw new InvalidArgumentException("Helper loader '$textual' is not " . ($able ? 'callable.' : 'valid PHP callback.'));
- 194: }
- 196: }
- 200: /**
- 201: * Returns all registered run-time helpers.
- 203: */
- 205: {
- 207: }
- 211: /**
- 212: * Call a template run-time helper. Do not call directly.
- 216: */
- 218: {
- 226: }
- 227: }
- 229: }
- 232: }
- 236: /**
- 237: * Sets translate adapter.
- 240: */
- 242: {
- 243: $this->registerHelper('translate', $translator === NULL ? NULL : array($translator, 'translate'));
- 244: }
- 248: /********************* template parameters ****************d*g**/
- 252: /**
- 253: * Adds new template parameter.
- 257: */
- 259: {
- 262: }
- 265: }
- 269: /**
- 270: * Sets all parameters.
- 273: */
- 275: {
- 277: }
- 281: /**
- 269: /**
- 270: * Returns array of all parameters.
- 284: */
- 286: {
- 288: }
- 292: /**
- 293: * Sets a template parameter. Do not call directly.
- 297: */
- 299: {
- 301: }
- 305: /**
- 306: * Returns a template parameter. Do not call directly.
- 309: */
- 311: {
- 314: }
- 317: }
- 321: /**
- 322: * Determines whether parameter is defined. Do not call directly.
- 325: */
- 327: {
- 329: }
- 333: /**
- 334: * Removes a template parameter. Do not call directly.
- 337: */
- 339: {
- 341: }
- 345: /********************* tools ****************d*g**/
- 349: /**
- 350: * Extracts all blocks of PHP code.
- 354: */
- 356: {
- 368: }
- 370: }
- 373: }
- 374: }
- 376: }
- 380: /**
- 381: * Removes unnecessary blocks of PHP code.
- 384: */
- 386: {
- 409: }
- 412: }
- 415: }
- 416: }
- 418: }
- 420: }