PHPackages                             ssa/ssa-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ssa/ssa-bundle

AbandonedArchivedSymfony-bundle[Framework](/categories/framework)

ssa/ssa-bundle
==============

ssa bundle for use ssa framework into Symfony

v1.0.1(11y ago)035PHP

Since Aug 3Pushed 11y agoCompare

[ Source](https://github.com/deblockt/ssaSymfony)[ Packagist](https://packagist.org/packages/ssa/ssa-bundle)[ RSS](/packages/ssa-ssa-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

SSA Symfony 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](https://github.com/deblockt/ssa)

### Installation

[](#installation)

Ssa bundle installation is very simple, you need just to add composer dependency.

*composer.json*

```
"require": {
  "ssa/ssa-bundle" : "dev-master",
}
```

If composer say "ssa/core" not found add this line in your composer file : *composer.json*

```
"require": {
  "ssa/core" : "dev-master",
}
```

Add the bundle in your kernel :

```
new Ssa\SsaBundle\SsaBundle()
```

Add the ssa routing in your routing.yml

*routing.yml*

```
_ssa:
    resource: "@SsaBundle/Resources/config/routing.yml"
```

After you can register your services into config.yml

*config.yml*

```
ssa :
    services :
        # serviceName is the ssa service name
        # service : is the symfony serivce
        serviceName : {service : 'ssa.test.service'}
        # or you can just export any methods of this service
        serviceName2 : {service : 'ssa.test.service', methods : ['methodToImport']}
        # if your service is not a symfony service you can use the class attribute
        serviceName3 : {class : '\Path\To\Your\Class', methods : ['methodToImport']}
```

And you can Simply import the javascript service with assetic, like this :

*file.html.twig*

```
{% javascripts
    'ssa:serviceName'
    'ssa:serviceName1'
    'ssa:serviceName2'
%}

{% endjavascripts  %}

```

you can now simply call your php service into your javascript file :

```
serviceName1
    .methodToImport('param1', {objectProp : 'ObjectValue', objectProp2 : 'ObjectValue2'})
    .done(function(data){
        console.log(data);
    });
```

### Support

[](#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*

```
Product :
  - id
  - name
  - price

```

*Database*

Id | Name | Price

1 | Foo | 10.0

*ProductService.php*

```
class ProductService {
    private $em;

    public function __construct(EntityManagerInterface $em) {
        $this->em = $em;
    }

    public function getProduct(Product $p) {
        return $p;
    }

    public function updateProduct(Product $p) {
        $this->em->persist($p);
        $this->em->flush();
        return $p;
    }
}
```

Javascript call :

```
productService.getProduct({id : 1}).done(function(data){
  // data.id = 1
  // data.name = "Foo"
  // data.price = 10.0
});

productService.updateProduct({name : 'Bar', price : 15}).done(function(data){
  // data.id = AutoGenerated value
  // data.name = 'Bar'
  // data.price = 15
});

productService.updateProduct({id : 1, price : 11.5}).done(function(data){
  // data.id = 1
  // data.name = 'Foo'
  // data.price = 11.5
});
```

### customization

[](#customization)

You can customize the framework with you own classes or change parameters.

#### Parameters

[](#parameters)

You can change any parameters on config.yml

*config.yml*

```
ssa :
    configuration :
        # the debug configuration, default is the symfony configuration
        debug : true | false
        # the cache configuration, by default there are no cache, the cachemode is not mandatory with symfony
        cacheMode : file | apc | memcache
        # the cache directory if cacheMode is file. default it's the kernel.cache_dir
        cacheDirectory :
        # the host for memcache cacheMode
        memcacheHost :
        # the port for memcache cacheMode
        memcachePort :
        # path to ssa js file, if you have your own ssa js implementation. Path begin in web directory
        ssaJsFile :
```

You can add your own resolver, if you want use specific resolver for your own class : [Ssa documentation](https://github.com/deblockt/ssa#add-type-support)

*config.yml*

```
ssa :
    parameterResolver :
        primitive :
            - YourFirstPrimitiveResolver
            - YoutSecondPrimitiveResolver
        object :
            - YourFirstObjectResolver
            - YourSecondObjectResolver
```

#### Implementation

[](#implementation)

You can change ssa implementation, add ssa parameters resolver, change route generator.

##### Route manager

[](#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*

```
parameters :
    ssa.runner.route : 'your_own_ssa_route_name'
```

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*

```
parameters :
    ssa.runner.route : Your\Own\UrlFactory
```

##### Parameter resolver

[](#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*

```
parameters :
    ssa.parameterResolver.class : Your\own\resolver
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Total

3

Last Release

4271d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5050163?v=4)[Thomas Deblock](/maintainers/deblockt)[@deblockt](https://github.com/deblockt)

---

Top Contributors

[![deblockt](https://avatars.githubusercontent.com/u/5050163?v=4)](https://github.com/deblockt "deblockt (41 commits)")

---

Tags

phpajaxssa

### Embed Badge

![Health badge](/badges/ssa-ssa-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ssa-ssa-bundle/health.svg)](https://phpackages.com/packages/ssa-ssa-bundle)
```

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[jaxon-php/jaxon-laravel

Jaxon library integration for the Laravel framework

101.8k4](/packages/jaxon-php-jaxon-laravel)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

263.7k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
