Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 64ab918

Browse files
Updated file structure, added composer autoloader
1 parent efd0eba commit 64ab918

File tree

14 files changed

+71
-29
lines changed

14 files changed

+71
-29
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor/

‎composer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "bram0/php-basic-mvc",
3+
"authors": [
4+
{
5+
"name": "Jose Abraham Castillo",
6+
"email": "crjoseabraham@gmail.com"
7+
}
8+
],
9+
"autoload": {
10+
"classmap": ["src/"]
11+
},
12+
"require": {}
13+
}
File renamed without changes.

‎config/credentials.php

Whitespace-only changes.

‎config/utilities.php

Whitespace-only changes.

‎public/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../app/bootstrap.php';
32

4-
// Init Core Library
5-
$init = new Core;
3+
require_once dirname(dirname(__FILE__)) . '/vendor/autoload.php';
4+
5+
$init = new Core\Router;

‎src/app/Router.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
namespace Core;
3+
4+
class Router
5+
{
6+
public function __construct()
7+
{
8+
echo $_SERVER['REQUEST_URI'];
9+
}
10+
11+
public static function get()
12+
{
13+
return 'get';
14+
}
15+
16+
public static function post()
17+
{
18+
return 'post';
19+
}
20+
}

‎src/app/routes.php

Whitespace-only changes.

‎src/bootstrap.php

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

‎src/libraries/Controller.php renamed to ‎src/controllers/Controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
namespace Controllers;
23
/**
34
* Base Controller
45
* Loads the models and views

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /