-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathIndexController.php
More file actions
33 lines (28 loc) · 1.19 KB
/
Copy pathIndexController.php
File metadata and controls
33 lines (28 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Module\Blog\Web\Controller;
use ModStart\Core\Input\Request;
use ModStart\Core\Input\Response;
use ModStart\Core\Util\ArrayUtil;
use ModStart\Core\Util\PageHtmlUtil;
use ModStart\Module\ModuleBaseController;
class IndexController extends ModuleBaseController
{
public function index(\Module\Blog\Api\Controller\BlogController $api)
{
$viewData = Response::tryGetData($api->paginate());
$viewData['pageHtml'] = PageHtmlUtil::render($viewData['total'], $viewData['pageSize'], $viewData['page'], '?' . Request::mergeQueries(['page' => ['{page}']]));
$viewData['pageTitle'] = ArrayUtil::firstValidValue(
modstart_config('siteName') . ' | ' . modstart_config('siteSlogan'),
Request::path() ? modstart_config('Blog_SeoTitle') : null
);
$viewData['pageKeywords'] = ArrayUtil::firstValidValue(
modstart_config('siteKeywords'),
modstart_config('Blog_SeoKeywords')
);
$viewData['pageDescription'] = ArrayUtil::firstValidValue(
modstart_config('siteDescription'),
modstart_config('Blog_SeoDescription')
);
return $this->view('blog.index', $viewData);
}
}