██████╗ ██╗ ██╗██████╗ ██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗███████╗██████╗
██╔══██╗██║ ██║██╔══██╗ ██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║██╔════╝██╔══██╗
██████╔╝███████║██████╔╝ ██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║█████╗ ██████╔╝
██╔═══╝ ██╔══██║██╔═══╝ ██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║██╔══╝ ██╔══██╗
██║ ██║ ██║██║ ███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║███████╗██║ ██║
╚═╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
It is a pseudo-framework for PHP developers to get a quick start with their projects with the highest control and lowest learning curve!
- PHP Launcher
We have our own installer software which eases the installation process via which you can get started with your projects with a few clicks. The installer is called PL Installer. Go to the repo, then go to Releases and download binary/exe from the latest release. After downloading, just run it and follow the instructions and you are done!
To enable controlled/custom routes insted of filesystem,go to /shell/.ev
and change the value of APP_ROUTE_SYSTEM
to the follwing
APP_ROUTE_SYSTEM=controlled
To declare routes go to /shell/routes/
.In there, there are 2 files i.e web.php
[that controlls norma routes where response is html] and api.php
[which controlls api routes for urls starting with /api/
and response type is JSON].The files content looks like this:
<?php
use Core/Router/Router;
$Router->add_routes(
Router::get('/')->name('home')->call('index'),
);
There, use Router::get('/route/path/')-name('route.name')->call('file.name')
format to declare new routes
To enable raw/filesystem based routes insted of declarative and controlled ones, go to /shell/.env
and change the value of APP_ROUTE_SYSTEM
to the following
APP_ROUTE_SYSTEM=raw
Now the routes will follow the name of the file, url/path/to/filename/
will output the contents of ./facade/path/to/filename.php
To dump variables, use d()
function
To dump variables and stop execution, use dd()
function
Static files are kept in either ./assets/
or ./node_modules/
directory. CSS, JS and Images are in respectively /css/
, /js/
and /images/
directory inside ./assets/
Use _image()
function to get the path
<img src="<?= _image('filename.extension') ?>" alt="">
<!-- output -->
<!-- <img src="href="http://url/assets/images/filename.extension" alt=""> -->
Use _css()
function to get the css inclusion code
<?php _css('filename');
// output:
//<link rel="stylesheet" href="http://url/assets/css/filename.css">
Use _js()
function to get the js inclusion code
<?php _js('filename');
// output:
//<script defer src="http://url/assets/js/filename.js"></script>
Use _node_css()
function to get the css inclusion code
<?php _node_css('path/to/filename.extension');
// output:
//<link rel="stylesheet" href="http://url/node_modules/path/to/filename.extension">
Use _node_js()
function to get the js inclusion code
<?php _node_js('path/to/filename.extension'); ?>
// output:
//<script defer src="http://url/node_modules/path/to/filename.extension"></script>
First enable csrf from .env
file and to do that, go to /shell/.env
and change the value of CSRF_ENABLED
to the following
CSRF_ENABLED=true
CSRF protection is only needed in post
requests. So, you need to include the CSRF token as a hidden input element in every form:post
forms. To do that just call _csrf()
function.
<form action="<?= ROUTER->postRoute('route.name') ?>" method="Post">
<?php _csrf() ?>
<!-- other input fields and submit button here -->
</form>