2017 © Pedro Pelรกez
 

library wheel-basic-app

basic application based on wheel components

image

sensorario/wheel-basic-app

basic application based on wheel components

  • Saturday, October 29, 2016
  • by sensorario
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Install

prompt> composer create-project sensorario/wheel-basic-app --prefer-dist
prompt> php -S localhost:8666 -t web

Wheel basic application

 โ”œโ”€โ”€ app
 โ”‚ย ย  โ””โ”€โ”€ config
 โ”‚ย ย      โ””โ”€โ”€ config.db.php
 โ”œโ”€โ”€ src
 โ”‚ย ย  โ””โ”€โ”€ MyApi
 โ”‚ย ย      โ”œโ”€โ”€ Components
 โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Config.php
 โ”‚ย ย      โ””โ”€โ”€ Controllers
 โ”‚ย ย          โ””โ”€โ”€ DefaultController.php
 โ”œโ”€โ”€ web
 โ”‚ย ย  โ””โ”€โ”€ index.php
 โ”œโ”€โ”€ composer.json
 โ”œโ”€โ”€ composer.lock
 โ””โ”€โ”€ readme.md

Controller

<?php

namespace MyApi\Controllers;

use Sensorario\WheelFramework\Controllers\Controller;

class DefaultController extends Controller
{
    public function default()
    {
        $response = [
            'message' => 'welcome',
        ];

        return $response;
    }
}

Create new routes

<?php

namespace MyApi\Components; 

use Sensorario\WheelFramework\Components\Config as SensorarioConfig;

class Config implements SensorarioConfig
{
    public function getConfig($key)
    {
        return array(

            'routes' => array(
                <path> => array(
                    'controller' => <controller>,
                    <http method> => array(
                        'action' => <method>
                    )
                )
            ),

        )[$key];
    }
}

If you want to add new json endpoint to show developer information:, (*1)

'/devel/info' => array(
    'controller' => 'Vendor\\Controllers\\DevelController',
    'GET' => array(
        'action' => 'show'
    )
)

Database

app/config/config.db.php, (*2)

<?php return array(
    'driver'   => 'pdo_mysql',
    'dbname'   => 'my_api',
    'user'     => 'root',
    'password' => '',
);

The Versions

29/10 2016

dev-master

9999999-dev

basic application based on wheel components

  Sources   Download

MIT

The Requires

 

27/10 2016

1.0.x-dev

1.0.9999999.9999999-dev

basic application based on wheel components

  Sources   Download

MIT

The Requires

 

27/10 2016

1.0.0

1.0.0.0

basic application based on wheel components

  Sources   Download

MIT

The Requires

 

27/10 2016

0.x-dev

0.9999999.9999999.9999999-dev

basic application based on wheel components

  Sources   Download

MIT

The Requires

 

27/10 2016

0.3

0.3.0.0

basic application based on wheel components

  Sources   Download

MIT

The Requires

 

27/10 2016

0.2

0.2.0.0

basic application based on wheel components

  Sources   Download

MIT

The Requires

 

27/10 2016

0.1

0.1.0.0

basic application based on wheel components

  Sources   Download

MIT

The Requires