Skip to content

Commit 4fe8753

Browse files
committed
changes to mod admin
1 parent da4d308 commit 4fe8753

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

app/HomeController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public function __construct (Template $template) {
1212
public function showIndex()
1313
{
1414
$msg='Welcome';
15+
$this->template->assign('page_title',$msg);
1516
return $this->template->display('layout.tpl');
1617
}
1718

app/views/layout.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<div class="masthead clearfix">
3939
<div class="inner">
40-
<h3 class="masthead-brand">webdevlabs</h3>
40+
<h3 class="masthead-brand">{$page_title}</h3>
4141
<nav>
4242
<ul class="nav masthead-nav">
4343
<li class="active"><a href="#">Home</a></li>

modules/admin/controllers/Dashboard.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ public function __construct (Template $template) {
99
$this->template = $template;
1010
}
1111

12-
public function showIndex() {
12+
public function anyIndex() {
1313
$msg='Welcome Admin!';
14-
return $this->template->display($msg);
14+
$this->template->assign('page_title',$msg);
15+
return $this->template->display('layout.tpl');
1516
}
1617

17-
public function anyIndex() {
18+
public function getDashboard() {
1819
$msg='Welcome Admin! This is your dashboard';
19-
return $this->template->display($msg);
20+
$this->template->assign('page_title',$msg);
21+
return $this->template->display('layout.tpl');
2022
}
2123

2224
}

modules/admin/routes.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
'before'=>'authadmin'
99
],
1010
function ($router) {
11-
$router->get('/', ['Modules\Admin\Controllers\Dashboard','showIndex'])
12-
->controller('/', 'Modules\Admin\Controllers\Dashboard');
11+
$router->controller('/', 'Modules\Admin\Controllers\Dashboard');
1312
});
1413

1514
/*

modules/test/front/controllers/Main.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public function __construct (Template $template, Model $model) {
1919
public function showIndex()
2020
{
2121
$msg = $this->model->getMsg();
22-
return $this->template->display($msg);
22+
$this->template->assign('page_title',$msg);
23+
return $this->template->display('layout.tpl');
2324
}
2425

2526
}

storage/cache/stash/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)