mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-30 08:01:07 -05:00
* 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
17 lines
353 B
PHTML
17 lines
353 B
PHTML
<?php
|
|
/** @var FreshRSS_ViewJavascript $this */
|
|
|
|
$result = array(
|
|
'feeds' => array(),
|
|
'tags' => array(),
|
|
);
|
|
foreach ($this->categories as $cat) {
|
|
foreach ($cat->feeds() as $feed) {
|
|
$result['feeds'][$feed->id()] = $feed->nbNotRead();
|
|
}
|
|
}
|
|
foreach ($this->tags as $tag) {
|
|
$result['tags'][$tag->id()] = $tag->nbUnread();
|
|
}
|
|
echo json_encode($result);
|