Skip to content

Commit f782ee0

Browse files
authored
Resolvendo problema com raiz do sistema
- Adicionado config para alterar a raiz do sistema -Integração do core com a config inserida acima
1 parent 303fa8b commit f782ee0

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/config/archiveComplementsParameters.php

+4
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@
2525
define('MODELS_COMPLEMENT', '.Class');
2626
define('VIEWS_COMPLEMENT', 'View');
2727
define('CORE_COMPLEMENT', '');
28+
29+
//Diretorio Raiz do sistema. Deve incluir index.php
30+
31+
define ('SYSTEM_DIRECTORY', '/mvc/index.php');

src/controllers/homeController.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<?php
22

3-
class homeController extends controller{
3+
class homeController extends controller
4+
{
45

56
public function index () {
67

7-
$this->loadView('index');
8-
return TRUE;
8+
$this->loadView('index');
9+
return true;
910

1011
}
1112

12-
public function index2 () {
13-
14-
echo "Hello World 2";
15-
return TRUE;
16-
17-
}
1813
}

src/core/core.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ class core
1515

1616
public function run () {
1717

18-
$this->urlParameters = substr(filter_input(INPUT_SERVER, 'PHP_SELF'), 15);
18+
$this->urlParameters = str_replace(
19+
20+
SYSTEM_DIRECTORY,
21+
'',
22+
filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_URL)
23+
24+
);
25+
1926
$this->makeParametersArray ();
2027
$this->setController ();
2128
$this->setAditionalParameters ();

src/views/indexView.php

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
</head>
1111

1212
<body>
13+
14+
Voce está na index
15+
1316
</body>
1417

1518
</html>

0 commit comments

Comments
 (0)