GithubHelp home page GithubHelp logo

informaticacba / unic-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unicframework/unic

1.0 0.0 0.0 281 KB

Unic is a high performance, open source web framework

Home Page: https://unicframework.github.io/docs

License: MIT License

PHP 95.72% HTML 4.28%

unic-framework's Introduction

Unic Framework

Unic Logo

Unic is a high performance, open source web application framework. Unic web framework follows the MVT (Model-View-Template) architectural pattern.

Features

  • Fast and Powerful.
  • Extremely Light Weight.
  • MVT Architecture.
  • Security and XSS Filtering.
  • Simple and Easy to learn.
  • Easy to Deploy on any server.

Installation

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.

Unic can be installed in few steps:

  • 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 with composer :

  • Install composer if you have not installed.
composer create-project unicframework/unic blog

It will create a blog project for you.

Simple Example

A simple Hello, World web application in unic web framework.

Create View

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.

Map URLs to Views

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.

Simple Web Api Example

A simple Hello, World web Api in unic web framework.

Create View

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.

Map URLs to Views

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.

Documentation

License

MIT License

unic-framework's People

Contributors

rajkumardusad avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.