Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
editorconfig, array syntax, comments
  • Loading branch information
bak11004 committed Nov 7, 2016
1 parent 4a8062a commit eb10a0f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.php]
indent_style = tab
indent_size = 2
13 changes: 7 additions & 6 deletions api/index.php
@@ -1,16 +1,17 @@
<?php

// use \Psr\Http\Message\ServerRequestInterface as Request;
// use \Psr\Http\Message\ResponseInterface as Response;
$autoloader = require './vendor/autoload.php';
$autoloader->add('', __DIR__ . '/generated-classes/');
require './generated-conf/config.php';
$autoloader = require './vendor/autoload.php'; // Composer Autoload Libraries
$autoloader->add('', __DIR__ . '/generated-classes/'); // Propel ORM Classes
require './generated-conf/config.php'; // Propel Config
require './config.php'; // Slim Config

$app = new \Slim\App();
// Init Slim
$app = new \Slim\App($config);

/**
* Routes
*/
require './routes/category.php';

// Run App
$app->run();
4 changes: 2 additions & 2 deletions api/routes/category.php
Expand Up @@ -11,10 +11,10 @@ $app->get('/category/all', function( $request, $response ) {
"data" => []
];
foreach( $cats as $cat ) {
$response_json["data"][] = array(
$response_json["data"][] = [
"id" => $cat->getId(),
"name" => $cat->getName()
);
];
}
$response = $response->withJSON($response_json);
return $response;
Expand Down

0 comments on commit eb10a0f

Please sign in to comment.