View.php 2.5 KB

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