webrium/core

PHP Framework

Maintainers

Details

github.com/webrium/core

Source

Issues

Installs: 880

Dependents: 5

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 2

Open Issues: 0

pkg:composer/webrium/core


README

Latest Stable Version Total Downloads Latest Unstable Version License

Webrium Core

Webrium Core has a set of features that make site development simpler and faster. Core is used to develop the Webrium framework, but if needed, all or part of its features can be used in other projects. Webrium Core includes facilities such as routes, file upload and download, session management, etc

1) install Webrium Core

composer require webrium/core

2) Create the index.php file

index.php

<?php

// Load Composer autoloader
require_once __DIR__ . '/../vendor/autoload.php';

// Import required classes
use Webrium\App;
use Webrium\Debug;
use Webrium\Route;

// Enable error display for debugging
Debug::enableErrorDisplay(true);

// Disable error logging to file
Debug::enableErrorLogging(false);

// Set application root path
App::setRootPath(__DIR__);

// Define home route
Route::get('/', function () {
    return ['message' => 'Hello World'];
});

// Start routing
Route::run();

3) Create the .htaccess file in app

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

Try it now 🎉