2017 © Pedro Peláez
 

library nano-framework

Nano Framework - easier than easiest framework

image

femtopixel/nano-framework

Nano Framework - easier than easiest framework

  • Monday, April 2, 2018
  • by jaymoulin
  • Repository
  • 1 Watchers
  • 3 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 13 Versions
  • 9 % Grown

The README.md

[!CAUTION] As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work., (*1)

[!NOTE], (*2)

logo, (*3)

Nano Framework

Build Status Latest Stable Version Minimum PHP Version Scrutinizer Code Quality Code Coverage License PayPal donation Buy me a coffee Buy me a coffee, (*4)

Nano is a simple stupid framework, really easy to handle, and really efficient., (*5)

It only implements the C part (Controller) of the MVC design pattern which allows developers to use any other existing library for others parts, (*6)

Installation

composer require femtopixel/nano-framework

Bootstrap

all your request can be redirected to your bootstrap (assuming index.php), (*7)

<?php
require_once ('vendor/autoload.php');
$nano = new \Nano\Framework();
$nano->dispatch();

That's all!, (*8)

How it works?

With that on, you can now access to your pages like this :, (*9)

http://mysite.tld/ <controller>/<action>, (*10)

And it will load the class \Project\Controller\<controller>::<method><action>Action, (*11)

You can easily configure your namespace, controller package and action suffix!, (*12)

<method> represents the HTTP method used (usually get but you can use post/update/delete etc...). This is optional., (*13)

Either <controller> or <action> are optional and considered as 'index' if not defined., (*14)

Therefore, (*15)

url class::method
http://mysite.tld/ \Project\Controller\Index::indexAction
http://mysite.tld/test \Project\Controller\Test::indexAction
http://mysite.tld/test/action \Project\Controller\Test::actionAction
http://mysite.tld/also/work/with/full/path \Project\Controller\Also\Work\With\Full::pathAction
http://mysite.tld/my/normal \Project\Controller\My::getNormalAction
http://mysite.tld/my/normal (with HTTP post) \Project\Controller\My::postNormalAction

Parameter Matching

Since 0.6.0, you can use "Parameter Matching", (*16)

Simply activate it when dispatching :, (*17)

require_once ('vendor/autoload.php');
$nano = new \Nano\Framework();
$nano->setParameterMatching()->dispatch();

And then you'll be able to use it like this :, (*18)

<?php
namespace \Project\Controller;

class MyAwesomeController
{
    public function getHelloAction($age, $name)
    {
        echo "Hello $name, I'm {$age}yo"; //please, use this code for test only
    }
}

and call http://mysite.tld/myawesomecontroller/hello?name=World&age=900 to display "Hello World, I'm 900yo" !, (*19)

The Versions

02/04 2018

dev-master

9999999-dev http://femtopixel.github.io/nano-framework

Nano Framework - easier than easiest framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

framework mvc lightweight easy simple php 7 quickstart efficient nano

24/07 2017

0.6.0

0.6.0.0 http://femtopixel.github.io/nano-framework

Nano Framework - easier than easiest framework

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

framework mvc lightweight easy simple php 7 quickstart efficient nano

01/11 2016

0.5.0

0.5.0.0 http://femtopixel.github.io/nano-framework

Nano Framework - easier than easiest framework

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

The Development Requires

framework mvc lightweight easy simple php 7 quickstart nano php 5.3 performant

23/10 2016

v0.4.0

0.4.0.0 http://femtopixel.github.io/nano-framework

Nano Framework - easier than easiest framework

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

The Development Requires

framework mvc lightweight easy simple php 7 quickstart nano php 5.3 performant

17/10 2016

v0.3.5

0.3.5.0 http://femtopixel.github.io/nano-framework

Nano Framework - easier than easiest framework

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

The Development Requires

framework mvc lightweight easy simple php 7 nano php 5.3 performant

10/06 2016

0.1.0

0.1.0.0

Nano Framework - easier than easiest things

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0