File tree Expand file tree Collapse file tree 8 files changed +8
-157
lines changed Expand file tree Collapse file tree 8 files changed +8
-157
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
11
/**
12
12
* Class HomeAction
13
13
*
14
- * This is an example of a HtmlAction. In every HtmlAction you have access to the HtmlResponder and
15
- * can render html templates.
14
+ * This is an example of a HtmlAction. In every HtmlAction you have access to the HtmlResponder.
16
15
*
17
16
* @package Bloatless\EndocoreApp\Actions
18
17
*/
@@ -27,17 +26,12 @@ class HomeAction extends HtmlAction
27
26
*/
28
27
public function __invoke (array $ arguments = []): Response
29
28
{
30
-
31
- // this assigns a template variable call "firstname" to your view:
32
- $ this ->responder ->assign (['firstname ' => 'Homer ' ]);
33
-
34
29
// Fetch some data from a domain:
35
30
$ domain = new HomeDomain ;
36
31
$ data = [
37
- 'name ' => $ domain ->getName (),
32
+ 'body ' => $ domain ->getWelcomeText (),
38
33
];
39
34
40
- // Render and return the "/resources/views/home.phtml" view. (Passing the array $data to the template):
41
- return $ this ->responder ->show ('home ' , $ data );
35
+ return $ this ->responder ->found ($ data );
42
36
}
43
37
}
Original file line number Diff line number Diff line change 14
14
class HomeDomain
15
15
{
16
16
/**
17
- * Retrieves a name .
17
+ * Retrieves welcome text .
18
18
*
19
19
* @return string
20
20
*/
21
- public function getName (): string
21
+ public function getWelcomeText (): string
22
22
{
23
- return $ _SERVER [ ' USER ' ] ?? ' Stranger ' ;
23
+ return ' <p>Hello World!<br>This is Endocore...</p> ' ;
24
24
}
25
25
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 17
17
},
18
18
"require" : {
19
19
"php" : " ^7.2" ,
20
- "bloatless/endocore" : " >=0.2 "
20
+ "bloatless/endocore" : " >=0.3 "
21
21
},
22
22
"scripts" : {
23
23
"post-create-project-cmd" : [
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
3
* This is your applications configuration file.
4
- * Please check if you need to adjust these settings (e.g. the database configuration) .
4
+ * Please check if you need to adjust these settings.
5
5
*/
6
6
7
7
return [
8
8
'logger ' => [
9
9
'path_logs ' => __DIR__ . '/../logs ' ,
10
10
'min_level ' => 'warning ' ,
11
11
],
12
-
13
- 'templating ' => [
14
- 'path_views ' => __DIR__ . '/../resources/views ' ,
15
- 'path_layouts ' => __DIR__ . '/../resources/views/layouts ' ,
16
- ],
17
-
18
- // If you want to use a MySQL database, you need to adjust these settings:
19
- 'db ' => [
20
- 'connections ' => [
21
- 'db1 ' => [ // name of your database connection
22
- 'driver ' => 'mysql ' ,
23
- 'host ' => 'localhost ' ,
24
- 'database ' => 'db1 ' ,
25
- 'username ' => 'root ' ,
26
- 'password ' => 'your-password ' ,
27
- 'charset ' => 'utf8 ' , // Optional
28
- 'timezone ' => 'Europe/Berlin ' , // Optional
29
- ],
30
-
31
- // add as many connections as you need...
32
- ],
33
-
34
- 'default_connection ' => 'db1 ' ,
35
- ],
36
12
];
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments