Skip to content

Commit 7a541d0

Browse files
committed
init
1 parent 3000222 commit 7a541d0

File tree

11 files changed

+81
-0
lines changed

11 files changed

+81
-0
lines changed

.htaccess

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RewriteEngine On
2+
RewriteBase /
3+
RewriteCond %{REQUEST_FILENAME} !-f
4+
RewriteCond %{REQUEST_FILENAME} !-d
5+
RewriteCond $1 !^(templates|plugins)
6+
RewriteRule ^(.*)$ index.php/$1 [L]

composer.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "yussan/php-mvc-boilerplate",
3+
"description": "pure php mvc(model view controller) boilerplate",
4+
"authors": [
5+
{
6+
"name": "yussandeveloper",
7+
"email": "[email protected]"
8+
}
9+
],
10+
"require": {}
11+
}

index.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
error_reporting(E_ALL);
4+
5+
require_once __DIR__.'/src/core/bootstrap.php';
6+
7+
$app = new Bootstrap();
8+
die('ready');
9+
return $app->start();
10+
11+
12+
\system\core\Config\Load::method();

src/controllers/controllers.php

Whitespace-only changes.

src/controllers/home.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
namespace src\controllers;
3+
4+
class HomeController
5+
{
6+
public function GetId()
7+
{
8+
return 'this is home in ID';
9+
}
10+
11+
public function getEn()
12+
{
13+
return 'this is home in EN';
14+
}
15+
16+
}

src/core/autoload.php

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
$includes = [];/var/log/apache2

src/core/bootstrap.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace src\core;
3+
4+
// use src\routes;
5+
6+
class bootstrap
7+
{
8+
public function __construct(routes $routes)
9+
{
10+
$this->routes = $routes;
11+
}
12+
13+
public function start()
14+
{
15+
echo 'mama';
16+
}
17+
}

src/index.php

Whitespace-only changes.

src/models/models.php

Whitespace-only changes.

src/routes.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace src;
3+
4+
use src\controllers\home as Home;
5+
6+
$routes = [
7+
'/directory/home/id' => $Home.getId,
8+
'/directory/home/en' => $Home.getEn
9+
];
10+
11+
class Routes
12+
{
13+
public function index()
14+
{
15+
return $routes;
16+
}
17+
}

src/views/home.php

Whitespace-only changes.

0 commit comments

Comments
 (0)