File tree Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ }
Original file line number Diff line number Diff line change 7
7
"label" : " PHP Server" ,
8
8
"type" : " shell" ,
9
9
"command" : " php -S localhost:8000"
10
+ },
11
+ {
12
+ "label" : " PHP Server (v5.6.36)" ,
13
+ "type" : " shell" ,
14
+ "command" : " C:/php/v5.6.36/php.exe -S localhost:8000 -t ${workspaceFolder}"
10
15
}
11
16
]
12
17
}
Original file line number Diff line number Diff line change 11
11
}
12
12
],
13
13
"require" : {
14
- "php-mvc-project/php-mvc" : " ^1.1.1 " ,
14
+ "php-mvc-project/php-mvc" : " ^1.2 " ,
15
15
"components/jquery" : " 1.12.4" ,
16
16
"twbs/bootstrap" : " 3.3.7"
17
17
}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class AccountController extends Controller {
17
17
18
18
public function __construct () {
19
19
// set model type for actions
20
- Model::use (array ('index ' , 'login ' ), 'Login ' );
20
+ Model::set (array ('index ' , 'login ' ), 'Login ' );
21
21
22
22
// required fields
23
23
Model::required ('Login ' , 'username ' );
@@ -52,6 +52,10 @@ public function index() {
52
52
// login action, only for POST requests
53
53
// because the $model is required and object
54
54
// url: /account/login
55
+
56
+ /**
57
+ * @param \RootNamespaceOfYourApp\Models\Login $model
58
+ */
55
59
public function login (\RootNamespaceOfYourApp \Models \Login $ model ) {
56
60
if (!$ this ->getModelState ()->isValid ()) {
57
61
// model is not valid, return login form
Original file line number Diff line number Diff line change 47
47
// AppBuilder::useCache(new PhpMvc\FileCacheProvider());
48
48
49
49
// custom handlers
50
- AppBuilder::use (function (PhpMvc \AppContext $ appContext ) {
50
+ AppBuilder::useAppContext (function (PhpMvc \AppContext $ appContext ) {
51
51
/*
52
52
// pre-init application handler
53
53
$appContext->addPreInit(function(PhpMvc\ActionContext $actionContext) {
Original file line number Diff line number Diff line change 51
51
52
52
<footer>
53
53
<div class="container">
54
- Copyright © My Application, <?= date ('Y ' )?>
54
+ Copyright © My Application, <?= date ('Y ' )?> <br />
55
+ <small>
56
+ This page is created in <?= round (microtime (true ) - PhpMvc \HttpContext::getCurrent ()->getRequest ()->server ('REQUEST_TIME_FLOAT ' ), 5 )?> seconds
57
+ <br />
58
+ PHP v<?= phpversion ()?> · PHP MVC Project v<?= PhpMvc \Info::VERSION ?>
59
+ </small>
55
60
</div>
56
61
</footer>
57
62
</body>
You can’t perform that action at this time.
0 commit comments