Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • FileTemplate
  • Helpers
  • Template

Interfaces

  • IFileTemplate
  • ITemplate
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Templating;
 9: 
10: use Nette,
11:     Latte;
12: 
13: 
14: /**
15:  * @deprecated
16:  */
17: class Helpers extends Latte\Runtime\Filters
18: {
19:     private static $helpers = array(
20:         'normalize' => 'Nette\Utils\Strings::normalize',
21:         'toascii' => 'Nette\Utils\Strings::toAscii',
22:         'webalize' => 'Nette\Utils\Strings::webalize',
23:         'padleft' => 'Nette\Utils\Strings::padLeft',
24:         'padright' => 'Nette\Utils\Strings::padRight',
25:         'reverse' =>  'Nette\Utils\Strings::reverse',
26:         'url' => 'rawurlencode',
27:     );
28: 
29: 
30:     /**
31:      * Try to load the requested helper.
32:      * @param  string  helper name
33:      * @return callable
34:      */
35:     public static function loader($helper)
36:     {
37:         if (method_exists(__CLASS__, $helper)) {
38:             return array(__CLASS__, $helper);
39:         } elseif (isset(self::$helpers[$helper])) {
40:             return self::$helpers[$helper];
41:         }
42:     }
43: 
44: 
45:     /**
46:      * Date/time modification.
47:      * @param  string|int|DateTime
48:      * @param  string|int
49:      * @param  string
50:      * @return Nette\Utils\DateTime
51:      */
52:     public static function modifyDate($time, $delta, $unit = NULL)
53:     {
54:         return $time == NULL // intentionally ==
55:             ? NULL
56:             : Nette\Utils\DateTime::from($time)->modify($delta . $unit);
57:     }
58: 
59: 
60:     /**
61:      * Returns array of string length.
62:      * @param  mixed
63:      * @return int
64:      */
65:     public static function length($var)
66:     {
67:         return is_string($var) ? Strings::length($var) : count($var);
68:     }
69: 
70: 
71:     /**
72:      * /dev/null.
73:      * @param  mixed
74:      * @return string
75:      */
76:     public static function null()
77:     {
78:         return '';
79:     }
80: 
81: 
82:     public static function optimizePhp($source, $lineLength = 80)
83:     {
84:         return Latte\Helpers::optimizePhp($source, $lineLength);
85:     }
86: 
87: }
88: 
Nette 2.3.1 API API documentation generated by ApiGen 2.8.0