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
This commit is contained in:
Alexandre Alapetite
2023-05-11 12:53:32 +02:00
committed by GitHub
parent 2343f0ded1
commit fe7d9bbcd6
14 changed files with 119 additions and 66 deletions

View File

@@ -2,6 +2,13 @@
class FreshRSS_javascript_Controller extends FreshRSS_ActionController {
/** @var FreshRSS_ViewJavascript */
protected $view;
public function __construct() {
parent::__construct(FreshRSS_ViewJavascript::class);
}
public function firstAction(): void {
$this->view->_layout(null);
}