File tree Expand file tree Collapse file tree 6 files changed +14
-18
lines changed Expand file tree Collapse file tree 6 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace App \Controllers ;
4
4
5
- use App \Controllers \BaseController ;
6
5
use App \Models \DungeonModel ;
7
6
use App \Models \HeroModel ;
8
7
@@ -39,7 +38,7 @@ public function show(int $id)
39
38
}
40
39
41
40
echo view ('dungeon ' , [
42
- 'dungeon ' => $ dungeon ,
41
+ 'dungeon ' => $ dungeon ,
43
42
'monsters ' => $ dungeon ->monsters (3 ),
44
43
]);
45
44
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace App \Controllers ;
4
4
5
- use App \Controllers \BaseController ;
6
5
use App \Models \HeroModel ;
7
6
use CodeIgniter \Exceptions \PageNotFoundException ;
8
7
@@ -17,9 +16,9 @@ class HeroController extends BaseController
17
16
*/
18
17
public function show (int $ id )
19
18
{
20
- // When you only need to use a model in a single place,
21
- // you can simply get a new instance here. It will use
22
- // the default database connection if none is passed in
19
+ // When you only need to use a model in a single place,
20
+ // you can simply get a new instance here. It will use
21
+ // the default database connection if none is passed in
23
22
// during instantiation.
24
23
$ heroes = new HeroModel ();
25
24
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function link(): string
39
39
/**
40
40
* Use another model to get some random data.
41
41
*/
42
- public function monsters (int $ limit= 5 )
42
+ public function monsters (int $ limit = 5 )
43
43
{
44
44
return model (MonsterModel::class)
45
45
->where ('dungeon_id ' , $ this ->id )
Original file line number Diff line number Diff line change 3
3
namespace App \Entities ;
4
4
5
5
use CodeIgniter \Entity \Entity ;
6
- use CodeIgniter \HTTP \Exceptions \HTTPException ;
7
- use InvalidArgumentException ;
8
6
9
7
/**
10
8
* Class Monster
Original file line number Diff line number Diff line change 1
1
<?php
2
- use Config \Services ;
3
2
use CodeIgniter \CodeIgniter ;
3
+ use Config \Services ;
4
4
5
5
$ errorId = uniqid ('error ' , true );
6
6
?>
89
89
90
90
<?php
91
91
$ params = null ;
92
- // Reflection by name is not available for closure function
93
- if (substr ($ row ['function ' ], -1 ) !== '} ' ) {
94
- $ mirror = isset ($ row ['class ' ]) ? new ReflectionMethod ($ row ['class ' ], $ row ['function ' ]) : new ReflectionFunction ($ row ['function ' ]);
95
- $ params = $ mirror ->getParameters ();
96
- }
92
+ // Reflection by name is not available for closure function
93
+ if (substr ($ row ['function ' ], -1 ) !== '} ' ) {
94
+ $ mirror = isset ($ row ['class ' ]) ? new ReflectionMethod ($ row ['class ' ], $ row ['function ' ]) : new ReflectionFunction ($ row ['function ' ]);
95
+ $ params = $ mirror ->getParameters ();
96
+ }
97
97
98
98
foreach ($ row ['args ' ] as $ key => $ value ) : ?>
99
99
<tr>
303
303
<!-- Response -->
304
304
<?php
305
305
$ response = Services::response ();
306
- $ response ->setStatusCode (http_response_code ());
307
- ?>
306
+ $ response ->setStatusCode (http_response_code ());
307
+ ?>
308
308
<div class="content" id="response">
309
309
<table>
310
310
<tr>
Original file line number Diff line number Diff line change 29
29
<div class="col-6 mx-auto">
30
30
31
31
<div class="card shadow">
32
- <img src="<?= base_url ('images/ ' . esc ($ hero ->image , 'attr ' )) ?> "
32
+ <img src="<?= base_url ('images/ ' . esc ($ hero ->image , 'attr ' )) ?> "
33
33
alt="<?= esc ($ hero ->name , 'attr ' ) ?> "
34
34
class="card-img-top"
35
35
>
You can’t perform that action at this time.
0 commit comments