changes
This commit is contained in:
parent
2400f8bd21
commit
ddd1fbdbd3
|
@ -1,8 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
use sealandia\framework\Template;
|
|
||||||
|
use Framework\Template;
|
||||||
|
|
||||||
class Welcome{
|
class Welcome{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the application welcome page.
|
||||||
|
*/
|
||||||
|
|
||||||
public function index(){
|
public function index(){
|
||||||
$template = new Template();
|
$template = new Template();
|
||||||
return $template->render('welcome', []);
|
return $template->render('welcome', []);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"sealandia\\": "./",
|
"App\\": "app/",
|
||||||
"sealandia\\framework\\": "framework/"
|
"Framework\\": "framework/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Framework;
|
||||||
|
|
||||||
use PDO;
|
use PDO;
|
||||||
|
|
||||||
class Auth{
|
class Auth{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Framework;
|
||||||
|
|
||||||
use PDO;
|
use PDO;
|
||||||
|
|
||||||
Class Database{
|
Class Database{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sealandia\framework;
|
namespace Framework;
|
||||||
|
|
||||||
class Router{
|
class Router{
|
||||||
|
|
||||||
|
@ -29,11 +29,10 @@ class Router{
|
||||||
|
|
||||||
if(array_key_exists($this->uri, $routes)){
|
if(array_key_exists($this->uri, $routes)){
|
||||||
list($controller, $method) = explode('@', $routes[$this->uri]);
|
list($controller, $method) = explode('@', $routes[$this->uri]);
|
||||||
|
|
||||||
$controllerPath = __DIR__ . '/../app/controllers/' . $controller . '.php';
|
$controllerPath = __DIR__ . '/../app/controllers/' . $controller . '.php';
|
||||||
|
|
||||||
if(file_exists($controllerPath)){
|
if(file_exists($controllerPath)){
|
||||||
require_once $controllerPath;
|
require $controllerPath;
|
||||||
$controller = new $controller();
|
$controller = new $controller();
|
||||||
|
|
||||||
if(method_exists($controller, $method)){
|
if(method_exists($controller, $method)){
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sealandia\framework;
|
namespace Framework;
|
||||||
|
|
||||||
class Template{
|
class Template{
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sealandia;
|
namespace Sealandia;
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use sealandia\framework\Router;
|
use Framework\Router;
|
||||||
|
|
||||||
$routes = [
|
$routes = [
|
||||||
'/' => 'Welcome@index',
|
'/' => 'Welcome@index',
|
||||||
|
|
Loading…
Reference in New Issue