parent
024a371590
commit
71d316d122
@ -0,0 +1,5 @@
|
|||||||
|
import { env } from "@extollo/lib"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
app_name: env('APP_NAME', 'Extollo'),
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
import {env} from '@extollo/lib'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
welcome_to_extollo: 'Welcome to Extollo!',
|
||||||
|
viewed_page_num_times: 'You have viewed this page :num: times.',
|
||||||
|
}
|
@ -1,16 +1,21 @@
|
|||||||
import {Controller, view, Session} from '@extollo/lib';
|
import {Controller, view, Session} from '@extollo/lib';
|
||||||
import {Inject, Injectable} from "@extollo/di";
|
import {Inject, Injectable} from "@extollo/di";
|
||||||
|
import {Locale} from "@extollo/i18n"
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Home extends Controller {
|
export class Home extends Controller {
|
||||||
@Inject()
|
@Inject()
|
||||||
protected readonly session!: Session;
|
protected readonly session!: Session;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
protected readonly locale!: Locale;
|
||||||
|
|
||||||
public welcome() {
|
public welcome() {
|
||||||
this.session.set('app_visits', this.session.get('app_visits', 0) + 1)
|
this.session.set('app_visits', this.session.get('app_visits', 0) + 1)
|
||||||
|
|
||||||
return view('welcome', {
|
return view('welcome', {
|
||||||
app_visits: this.session.get('app_visits')
|
app_visits: this.session.get('app_visits'),
|
||||||
|
locale: this.locale.helper(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
html
|
html
|
||||||
head
|
head
|
||||||
title Welcome | Extollo
|
title !{locale('app_name')}
|
||||||
body
|
body
|
||||||
h1 Welcome to Extollo
|
h1 !{locale('welcome_to_extollo')}
|
||||||
h2 You have viewed this page !{app_visits} times.
|
h2 !{locale('viewed_page_num_times', { interp: { num: app_visits } })}
|
||||||
|
Loading…
Reference in new issue