Giter Site home page Giter Site logo

parkerj / liten Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 1.0 396 KB

Liten is a small and simple micro framework which can be used to build restful services and apps.

Home Page: https://www.litenframework.com/

License: MIT License

PHP 100.00%
micro-framework framework rest-api restful

liten's Introduction

Liten

Build Status Latest Stable Version Total Downloads License Join the chat at https://gitter.im/parkerj/Liten

Liten is a small and simple microframework. Even though it is small, you can still use it to build intelligent and dynamic restful api's.

System Requirement

Minimum PHP version 5.4

Features

  • Simple Configuration
  • Static Routes
  • Dynamic Routes
  • Route Subpatterns
  • Group Routing
  • Before Route Middlewares
  • Before Router Middlewares
  • After Router Middlewares
  • HTTP methods and responses

Install

$ composer require liten/liten

Rewrite Rules

.htaccess

RewriteEngine On
 
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Nginx (root directory)

location / {
    try_files $uri /index.php$is_args$args;
}

Nginx (subdirectory)

location /liten {
    try_files $uri /liten/index.php$is_args$args;
}

Hello World Example

Instantiate a new Liten Application:

$app = new \Liten\Liten();

GET Route:

$app->get('/hello/(\w+)/' function($name) {
    echo "Howdy, $name";
}

Run the new Liten Application

$app->run();

Sample Application

The Liten Blog is a sample application to show what you can do with the Liten Framework.

Documentation & Community

Would love to have your input and help into making Liten a small but yet powerful micro framework. Head on over to the online documentation site to ask questions and or make suggestions.

liten's People

Contributors

gitter-badger avatar

Stargazers

Akif Biçek avatar Thomas D'Ascoli avatar Dmitriy Kepov avatar  avatar Software Nerd avatar André Philip avatar Nana Axel avatar desbest avatar Fábio Assunção avatar

Watchers

André Philip avatar James Cloos avatar

Forkers

smartnetguru

liten's Issues

Error in Lite.php

I get this error on startup:

Parse error: syntax error, unexpected '[' in C:\wamp\www\Liten-master\Liten\Liten.php on line 48

Yet when I try to edit Lite.php, line 48 is:

protected static $_apps = [];

Unable to procede

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.