Unic is a high performance, open source web application framework. Unic web framework follows the MVT (Model-View-Template) architectural pattern.
- Fast and Powerful.
- Extremely Light Weight.
- MVT Architecture.
- Security and XSS Filtering.
- Simple and Easy to learn.
- Easy to Deploy on any server.
Unic web framework is for PHP, so it's requires PHP 5.6 or newer. now you won’t need to setup anything just yet.
- Download the unic framework.
- Unzip the package.
That's it, in the unic web framework there is nothing to configure and setup. it's always ready to go.
- Install
composer
if you have not installed.
composer create-project unicframework/unic blog
It will create a blog
project for you.
A simple Hello, World
web application in unic web framework.
Let’s write the first view. Open the app/view.php
file and put the following PHP code in it:
class view extends Views {
//Home view
function home(Request $req) {
return $this->response('Hello, World !!');
}
}
home
view is created, now map this view to URL.
Let's create URL and map to views. open app/urls.php
file and put the following code in it:
//Include views
require_once 'view.php';
$urlpatterns = [
'/' => 'view.home',
];
Now a simple Hello World
web app is created.
A simple Hello, World
web Api in unic web framework.
Let’s write the first view. Open the app/view.php
file and put the following PHP code in it:
class view extends Views {
//Home view
function home(Request $req) {
$data = [
'status' => true,
'data' => 'Hello, World',
];
//Send json response
return $this->response_json($data);
}
}
home
view is created, now map this view to URL.
Let's create URL and map to views. Open app/urls.php
file and put the following code in it:
//Include views
require_once 'view.php';
$urlpatterns = [
'/' => 'view.home',
];
Now a simple Hello, World
web api is created.
- Learn more about Unic from Documentation file.
- Documentation : https://unicframework.github.io/docs