denisok94 / symfony-helper
Symfony helper
Installs: 977
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.4|>=8.0
- denisok94/helper: >=0.8.0|dev-develop
- jms/serializer-bundle: *
- mashape/unirest-php: ^3.0
README
Installation
Run:
composer require --prefer-dist denisok94/symfony-helper
# or
php composer.phar require --prefer-dist denisok94/symfony-helper
or add to the require
section of your composer.json
file:
"denisok94/symfony-helper": "*"
composer update
# or
php composer.phar update
Setting
// ~config/bundles.php return [ //.. Denisok94\SymfonyHelper\Denisok94SymfonyHelperBundle::class => ['all' => true], ];
Унаследовать настройки родительского контроллера
# ~config/services.yaml # global if all controller extends ApiRestController or ApiListController App\Controller\: parent: 'denisok94.controller.api_rest_controller' # or individual App\Controller\MyController: parent: 'denisok94.controller.api_rest_controller'
Возвращать ошибки в формате json
# ~config/packages/framework.yaml framework: error_controller: Denisok94\SymfonyHelper\Controller\JsonErrorController::show
Возвращать ошибки доступа в формате json
# ~config/packages/security.yaml security: firewalls: main: # or other name use access_denied_handler: Denisok94\SymfonyHelper\Security\AccessDeniedHandler