Source for file Template.php
Documentation is available at Template.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 https://nette.org
- 12: *
- 19: */
- 29: /**
- 30: * Template.
- 31: *
- 35: */
- 37: {
- 64: /**
- 65: * Sets the path to the template file.
- 68: */
- 70: {
- 72: }
- 76: /**
- 77: * Returns the path to the template file.
- 79: */
- 81: {
- 83: }
- 87: /**
- 88: * Creates subtemplate.
- 92: */
- 94: {
- 105: }
- 107: }
- 115: }
- 118: }
- 122: /**
- 123: * Registers callback as template filter.
- 126: */
- 128: {
- 133: }
- 135: }
- 139: /********************* rendering ****************d*g**/
- 143: /**
- 144: * Renders template to output.
- 146: */
- 148: {
- 154: }
- 161: }
- 173: throw new InvalidStateException("Filter '$textual' is not " . ($able ? 'callable.' : 'valid PHP callback.'));
- 174: }
- 176: // remove PHP code
- 189: }
- 191: }
- 194: }
- 195: }
- 201: throw new InvalidStateException("Filter $textual: " . $e->getMessage() . " (in file $this->file)", 0, $e);
- 202: }
- 205: }
- 214: )
- 217: }
- 225: }
- 226: }
- 230: /**
- 231: * Renders template to string.
- 234: */
- 236: {
- 249: }
- 250: }
- 251: }
- 255: /**
- 256: * Converts to SimpleXML. (experimental)
- 258: */
- 260: {
- 262: $dom->loadHTML('<html><meta http-equiv="Content-Type" content="text/html;charset=utf-8">' . str_replace("\r", '', $this->__toString()) . '</html>');
- 264: //return simplexml_load_string('<xml>' . $this->__toString() . '</xml>');
- 265: }
- 269: /********************* template helpers ****************d*g**/
- 273: /**
- 274: * Registers callback as template helper.
- 278: */
- 280: {
- 284: throw new InvalidArgumentException("Helper handler '$textual' is not " . ($able ? 'callable.' : 'valid PHP callback.'));
- 285: }
- 287: }
- 291: /**
- 292: * Registers callback as template helpers loader.
- 295: */
- 297: {
- 301: throw new InvalidArgumentException("Helper loader '$textual' is not " . ($able ? 'callable.' : 'valid PHP callback.'));
- 302: }
- 304: }
- 308: /**
- 309: * Call a template helper. Do not call directly.
- 313: */
- 315: {
- 323: }
- 324: }
- 326: }
- 329: }
- 333: /**
- 334: * Sets translate adapter.
- 337: */
- 339: {
- 340: $this->registerHelper('translate', $translator === NULL ? NULL : array($translator, 'translate'));
- 341: }
- 345: /********************* template parameters ****************d*g**/
- 349: /**
- 350: * Adds new template parameter.
- 354: */
- 356: {
- 359: }
- 362: }
- 366: /**
- 367: * Adds new template as parameter.
- 371: */
- 373: {
- 377: }
- 381: /**
- 382: * Returns array of all parameters.
- 384: */
- 386: {
- 388: }
- 392: /**
- 393: * Sets a template parameter. Do not call directly.
- 397: */
- 399: {
- 401: }
- 405: /**
- 406: * Returns a template parameter. Do not call directly.
- 409: */
- 411: {
- 413: trigger_error("The variable '$name' does not exist in template '$this->file'", E_USER_WARNING);
- 414: }
- 417: }
- 421: /**
- 422: * Determines whether parameter is defined. Do not call directly.
- 425: */
- 427: {
- 429: }
- 433: /**
- 434: * Removes a template parameter. Do not call directly.
- 437: */
- 439: {
- 441: }
- 445: /********************* caching ****************d*g**/
- 449: /**
- 450: * Set cache storage.
- 453: */
- 455: {
- 457: }
- 461: /**
- 463: */
- 465: {
- 468: }
- 470: }
- 472: }