diff options
| author | 2023-05-11 12:53:32 +0200 | |
|---|---|---|
| committer | 2023-05-11 12:53:32 +0200 | |
| commit | fe7d9bbcd68660a59b813346c236b61b25a51c80 (patch) | |
| tree | 95be837c2838659a3ea72974c9f9b18b1ee634ca /app/Controllers/statsController.php | |
| parent | 2343f0ded14ac6970575c23e4de34e536241b623 (diff) | |
Typed view model classes (#5380)
* Typed view model classes
* Add ability to provide a typed view model class to a controller
* Use `::class` instead of string for referring to classes
* Examplified with `stats` and `javascript` controllers / views (more to do)
* Also useful for extensions (my usecase today), which did not have the ability to define own view model attributes before.
* Typo
Diffstat (limited to 'app/Controllers/statsController.php')
| -rw-r--r-- | app/Controllers/statsController.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 79facbbf6..d9c4fe5f4 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -5,6 +5,13 @@ */ class FreshRSS_stats_Controller extends FreshRSS_ActionController { + /** @var FreshRSS_ViewStats */ + protected $view; + + public function __construct() { + parent::__construct(FreshRSS_ViewStats::class); + } + /** * This action is called before every other action in that class. It is * the common boilerplate for every action. It is triggered by the |
