Download the PHP package ssa/ssa-bundle without Composer
On this page you can find all versions of the php package ssa/ssa-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ssa-bundle
SSA Symfony bundle
Ssa is a framework for access to your php service in your javascript code. This project is the ssa integration on symfony 2. Ssa project
Installation
Ssa bundle installation is very simple, you need just to add composer dependency.
composer.json
If composer say "ssa/core" not found add this line in your composer file : composer.json
Add the bundle in your kernel :
Add the ssa routing in your routing.yml
routing.yml
After you can register your services into config.yml
config.yml
And you can Simply import the javascript service with assetic, like this :
file.html.twig
you can now simply call your php service into your javascript file :
Support
Ssa allow to call php service into javascript code. Ssa in symfony add a parameter resolver. It can convert json oject into your doctrine entity. Example : Entity
Database
Id | Name | Price
1 | Foo | 10.0
ProductService.php
Javascript call :
customization
You can customize the framework with you own classes or change parameters.
Parameters
You can change any parameters on config.yml
config.yml
You can add your own resolver, if you want use specific resolver for your own class : Ssa documentation
config.yml
Implementation
You can change ssa implementation, add ssa parameters resolver, change route generator.
Route manager
Routes are use for generate url to call php services, by default the ssa_run_service route is used. You have two way for change route generation. The first is to change the route name used :
service.yml
Or you can completly change the class use for generate route, your class must implements ssa\converter\UrlFactory interface, your constructor must have two parameters Symfony\Component\Routing\RouterInterface $router and $routeName. For change the class used you must change the ssa.urlFactory.class parameter :
service.yml
Parameter resolver
If you want use your own parameter resolver, you can set the class used. the parameter resolver is used for convert get or post parameter in php object. Your parameter resolver need to extends ssa\runner\resolver\impl\DefaultParameterResolver or implements ssa\runner\resolver\ParameterResolver. Your must change the parameter ssa.parameterResolver.class for use your own parameterResolver.
service.yml