From fe7d9bbcd68660a59b813346c236b61b25a51c80 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 11 May 2023 12:53:32 +0200 Subject: 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 --- app/Controllers/statsController.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/Controllers/statsController.php') 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 -- cgit v1.2.3