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
- Route Class Documentation
- Session Class Documentation
- JWT (JSON Web Token) Documentation
- Hash Class Documentation
- HTTP Class Documentation
- Email Documentation
- install core
composer require webrium/core
-
create the app Directory
-
create the index.php file in app
index.php
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use Webrium\App;
use Webrium\Debug;
use Webrium\Route;
Debug::showErrorsStatus(true);
Debug::writErrorsStatus(false);
// init index path
App::root(__DIR__);
Route::get('', function ()
{
return ['message'=>'successful'];
});
- create the .htaccess file in app
.htaccess
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
Output (http://localhost/app/)
{"message":"successful"}