View.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Config;
  3. use CodeIgniter\Config\View as BaseView;
  4. use CodeIgniter\View\ViewDecoratorInterface;
  5. /**
  6. * @phpstan-type parser_callable (callable(mixed): mixed)
  7. * @phpstan-type parser_callable_string (callable(mixed): mixed)&string
  8. */
  9. class View extends BaseView
  10. {
  11. /**
  12. * When false, the view method will clear the data between each
  13. * call. This keeps your data safe and ensures there is no accidental
  14. * leaking between calls, so you would need to explicitly pass the data
  15. * to each view. You might prefer to have the data stick around between
  16. * calls so that it is available to all views. If that is the case,
  17. * set $saveData to true.
  18. *
  19. * @var bool
  20. */
  21. public $saveData = true;
  22. /**
  23. * Parser Filters map a filter name with any PHP callable. When the
  24. * Parser prepares a variable for display, it will chain it
  25. * through the filters in the order defined, inserting any parameters.
  26. * To prevent potential abuse, all filters MUST be defined here
  27. * in order for them to be available for use within the Parser.
  28. *
  29. * Examples:
  30. * { title|esc(js) }
  31. * { created_on|date(Y-m-d)|esc(attr) }
  32. *
  33. * @var array<string, string>
  34. * @phpstan-var array<string, parser_callable_string>
  35. */
  36. public $filters = [];
  37. /**
  38. * Parser Plugins provide a way to extend the functionality provided
  39. * by the core Parser by creating aliases that will be replaced with
  40. * any callable. Can be single or tag pair.
  41. *
  42. * @var array<string, callable|list<string>|string>
  43. * @phpstan-var array<string, list<parser_callable_string>|parser_callable_string|parser_callable>
  44. */
  45. public $plugins = [];
  46. /**
  47. * View Decorators are class methods that will be run in sequence to
  48. * have a chance to alter the generated output just prior to caching
  49. * the results.
  50. *
  51. * All classes must implement CodeIgniter\View\ViewDecoratorInterface
  52. *
  53. * @var list<class-string<ViewDecoratorInterface>>
  54. */
  55. public array $decorators = [];
  56. }