https://github.com/fbn/requiem
A php Symfony 2 enhancement
https://github.com/fbn/requiem
Last synced: 7 months ago
JSON representation
A php Symfony 2 enhancement
- Host: GitHub
- URL: https://github.com/fbn/requiem
- Owner: FbN
- Created: 2010-12-17T23:17:26.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-12-17T23:39:05.000Z (over 15 years ago)
- Last Synced: 2025-01-22T19:48:49.718Z (over 1 year ago)
- Language: PHP
- Homepage: cutiecode.maniacmansion.it
- Size: 93.8 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
_____ _
| __ |___ ___ _ _|_|___ _____
| -| -_| . | | | | -_| |
|__|__|___|_ |___|_|___|_|_|_|
|_|
---- Symfony2 enahancement ----
Requiem is a php Symfony 2 enhancement
It's a bundle so to install it simple download and install it under /Bundle/Requiem
folder of your Symfony 2.0 project.
For the moment the budle give you 3 features
[1] RequiemController
Using RequiemController instead of a normal controller you can declare service as member
and directly use them so for example you can do a controller like this
use Bundle\Requiem\Services\RequiemController;
class TestController extends RequiemController {
//automatic filled with the doctrine em
public $entityService;
//automatic filled with the request object
public $requestService;
public function indexAction() {
$query = $this->entityService->createQuery('SELECT u FROM TestBundle:User u WHERE u.email = "'.$this->requestService->get('email').'"');
,,,
}
}
[2] RestRequiemController
A special controller useful for rest. Colling it's handle method from the routing it directly call the right action based on the http method
rest:
pattern: /rest
defaults: { _controller: TestBundle:Test:handle }
use Bundle\Requiem\Services\RestRequiemController;
class TestController extends RestRequiemController {
public $entityService;
public $requestService;
public function doGet() {
,,,
}
public function doPost() {
,,,
}
}
[3] RequiemService
Extend this class to have a class with access to the container and the autobind like a RequiemController
Chears
Taioli Fabiano
http://cutiecode.maniacmansion.it