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
25 lines
746 B
PHTML
25 lines
746 B
PHTML
<?php
|
|
/** @var FreshRSS_ViewJavascript $this */
|
|
|
|
$categories = [];
|
|
foreach ($this->categories as $category) {
|
|
$categories[] = [
|
|
'url' => Minz_Url::display(array('c' => 'category', 'a' => 'refreshOpml', 'params' => array('id' => $category->id(), 'ajax' => '1')), 'php'),
|
|
'title' => $category->name(),
|
|
];
|
|
}
|
|
|
|
$feeds = array();
|
|
foreach ($this->feeds as $feed) {
|
|
$feeds[] = array(
|
|
'url' => Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'),
|
|
'title' => $feed->name(),
|
|
);
|
|
}
|
|
echo json_encode(array(
|
|
'categories' => $categories,
|
|
'feeds' => $feeds,
|
|
'feedback_no_refresh' => _t('feedback.sub.feed.no_refresh'),
|
|
'feedback_actualize' => _t('feedback.sub.actualize'),
|
|
));
|