Skip to content

Instantly share code, notes, and snippets.

Created February 19, 2017 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/45c2cd05c364f00dbb9347a3c30597a0 to your computer and use it in GitHub Desktop.
Save anonymous/45c2cd05c364f00dbb9347a3c30597a0 to your computer and use it in GitHub Desktop.
Slim Project
wwwroot/
{
"name": "you-reward/app",
"description": "Rewards API for business customers",
"license": "proprietary",
"require": {
"slim/slim": "^3.0",
"slim/php-view": "^2.2",
"oscarotero/psr7-middlewares": "^3.19"
},
"autoload": {
"psr-4": {
"YouReward\\App\\": "src/"
}
}
}
wwwroot/
<?php
require 'vendor/autoload.php';
use Slim\App;
use Slim\Route;
use Psr7Middlewares\Middleware\TrailingSlash;
$app = new App;
$app->add(new TrailingSlash(true));
$app->group('/v1', function()
{
new YouReward\App\v1\Controllers\UserController($this);
});
$app->run();
wwwroot/src/v1/controllers/UserController.php
<?php
namespace YouReward\App\v1\Controllers;
class UserController{
public function __construct(){
echo 'Hello';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment