Source for file BaseTemplate.php
Documentation is available at BaseTemplate.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 11: */
- 15: /**
- 16: * Template.
- 17: *
- 20: */
- 22: {
- 26: /** @var array of function(BaseTemplate $sender); Occurs before a template is compiled - implement to customize the filters */
- 43: /**
- 44: * Registers callback as template compile-time filter.
- 47: */
- 49: {
- 53: }
- 55: }
- 59: /**
- 60: * Returns all registered compile-time filters.
- 62: */
- 64: {
- 66: }
- 70: /********************* rendering ****************d*g**/
- 74: /**
- 75: * Renders template to output.
- 78: */
- 80: {
- 81: }
- 85: /**
- 86: * Renders template to string.
- 89: */
- 91: {
- 103: }
- 104: }
- 105: }
- 109: /**
- 110: * Applies filters on template content.
- 114: */
- 116: {
- 119: }
- 126: }
- 128: throw new InvalidStateException("Filter $filter: " . $e->getMessage() . ($label ? " (in $label)" : ''), 0, $e);
- 129: }
- 133: }
- 136: }
- 140: /********************* template helpers ****************d*g**/
- 144: /**
- 145: * Registers callback as template run-time helper.
- 149: */
- 151: {
- 153: }
- 157: /**
- 158: * Registers callback as template run-time helpers loader.
- 161: */
- 163: {
- 165: }
- 169: /**
- 170: * Returns all registered run-time helpers.
- 172: */
- 174: {
- 176: }
- 180: /**
- 181: * Call a template run-time helper. Do not call directly.
- 185: */
- 187: {
- 195: }
- 196: }
- 198: }
- 201: }
- 205: /**
- 206: * Sets translate adapter.
- 209: */
- 211: {
- 212: $this->registerHelper('translate', $translator === NULL ? NULL : array($translator, 'translate'));
- 214: }
- 218: /********************* template parameters ****************d*g**/
- 222: /**
- 223: * Adds new template parameter.
- 227: */
- 229: {
- 232: }
- 235: }
- 239: /**
- 240: * Sets all parameters.
- 243: */
- 245: {
- 248: }
- 252: /**
- 239: /**
- 240: * Returns array of all parameters.
- 255: */
- 257: {
- 259: }
- 263: /**
- 264: * Sets a template parameter. Do not call directly.
- 268: */
- 270: {
- 272: }
- 276: /**
- 277: * Returns a template parameter. Do not call directly.
- 280: */
- 282: {
- 285: }
- 288: }
- 292: /**
- 293: * Determines whether parameter is defined. Do not call directly.
- 296: */
- 298: {
- 300: }
- 304: /**
- 305: * Removes a template parameter. Do not call directly.
- 308: */
- 310: {
- 312: }
- 316: /********************* tools ****************d*g**/
- 320: /**
- 321: * Extracts all blocks of PHP code.
- 325: */
- 327: {
- 337: } elseif ($token[0] === T_OPEN_TAG && $token[1] === '<?' && isset($tokens[$n+1][1]) && $tokens[$n+1][1] === 'xml') {
- 344: }
- 349: }
- 350: }
- 352: }
- 356: /**
- 357: * Removes unnecessary blocks of PHP code.
- 360: */
- 362: {
- 378: if ($lastChar !== ';' && $lastChar !== '{' && $lastChar !== '}' && $lastChar !== ':' && $lastChar !== '/' ) $php .= $lastChar = ';';
- 388: }
- 391: if ($tokens[$key + 1] === ':' && $lastChar === '}') $php .= ';'; // semicolon needed in if(): ... if() ... else:
- 398: }
- 401: }
- 402: }
- 404: }
- 406: }