Skip to content

Commit cf2cd94

Browse files
committed
Adjust application to Endocore v0.3.0
1 parent d542a62 commit cf2cd94

File tree

8 files changed

+8
-157
lines changed

8 files changed

+8
-157
lines changed

app/Actions/DbDemoAction.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

app/Actions/HomeAction.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
/**
1212
* Class HomeAction
1313
*
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.
1615
*
1716
* @package Bloatless\EndocoreApp\Actions
1817
*/
@@ -27,17 +26,12 @@ class HomeAction extends HtmlAction
2726
*/
2827
public function __invoke(array $arguments = []): Response
2928
{
30-
31-
// this assigns a template variable call "firstname" to your view:
32-
$this->responder->assign(['firstname' => 'Homer']);
33-
3429
// Fetch some data from a domain:
3530
$domain = new HomeDomain;
3631
$data = [
37-
'name' => $domain->getName(),
32+
'body' => $domain->getWelcomeText(),
3833
];
3934

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);
4236
}
4337
}

app/Domains/HomeDomain.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
class HomeDomain
1515
{
1616
/**
17-
* Retrieves a name.
17+
* Retrieves welcome text.
1818
*
1919
* @return string
2020
*/
21-
public function getName(): string
21+
public function getWelcomeText(): string
2222
{
23-
return $_SERVER['USER'] ?? 'Stranger';
23+
return '<p>Hello World!<br>This is Endocore...</p>';
2424
}
2525
}

app/Domains/MyDatabaseDomain.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"require": {
1919
"php": "^7.2",
20-
"bloatless/endocore": ">=0.2"
20+
"bloatless/endocore": ">=0.3"
2121
},
2222
"scripts": {
2323
"post-create-project-cmd": [

config/config.sample.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
11
<?php
22
/**
33
* 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.
55
*/
66

77
return [
88
'logger' => [
99
'path_logs' => __DIR__ . '/../logs',
1010
'min_level' => 'warning',
1111
],
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-
],
3612
];

resources/views/home.phtml

Lines changed: 0 additions & 10 deletions
This file was deleted.

resources/views/layouts/default.phtml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)