Skip to content

Commit 2df8eeb

Browse files
author
Alistair Kearney
committed
Updated for v0.2.0
1 parent 118ca6c commit 2df8eeb

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
None
7+
8+
## [0.2.0] - 2016-05-03
69
#### Added
710
- Transformer and Transformation classes.
811
- Added APIFrameworkJSONRendererAppendTransformations delegate
912
- Added phpunit to composer require-dev
1013
- Added unit tests for Transformation code
1114
- Controller names are based on full page path (#5)
15+
- Using PSR-4 folder structure for controllers. Controllers must have a namespace. (#7)
1216

1317
#### Fixed
1418
- Checking that controller actually exists before trying to include it (#6)
@@ -33,5 +37,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3337
- Initial release
3438
- Added Symphony PDO as requirement
3539

36-
[Unreleased]: https://github.com/pointybeard/api_framework/compare/v0.1.1...master
40+
[Unreleased]: https://github.com/pointybeard/api_framework/compare/v0.2.0...integration
41+
[0.1.2]: https://github.com/pointybeard/api_framework/compare/v0.1.1...v0.2.0
3742
[0.1.1]: https://github.com/pointybeard/api_framework/compare/v0.1.0...v0.1.1

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,16 @@ Lastly, call the render method (which is inherited) to generate the output. E.g.
131131

132132
return $this->render($response, ['data' => 'some output']);
133133

134-
A controllers class and file name are the same. It is based on the full path to your page.
134+
A controllers class and file name are the same. Each controller must sit in a folder path that matches your page path.
135135

136-
For example, if you had a page called "entry", and you wanted to provide PUT, POST, PATCH and DELETE functionality, name your controller class "ControllerEntry" and the file `ControllerEntry.php`. If that same page was then a child of a page called "parent", than both the class and file names would be "ControllerParentEntry" instead.
136+
For example, if you had a page called "entry", and you wanted to provide PUT, POST, PATCH and DELETE functionality, name your controller class "ControllerEntry" and the file `ControllerEntry.php`. It should be placed in `/workspace/controllers`. If that same page was then a child of a page called "parent", you must create a new folder called `parent` inside `/workspace/controllers`. Place `ControllerEntry` in this new folder. Be sure to adjust its namespace accordingly. **Note: Be sure to rebuild your composer autoloader (`composer dumpautoload`) whenever you move or create a new Controller.**
137137

138138
Here is an example of a completed controller:
139139

140140
<?php
141141

142+
namespace Symphony\ApiFramework\Controllers;
143+
142144
use Symfony\Component\HttpFoundation\Request;
143145
use Symfony\Component\HttpFoundation\Response;
144146
use Symphony\ApiFramework\Lib\AbstractController;

0 commit comments

Comments
 (0)