KablauJoustra/KJSencha — pull request #8 by Ocramius (2012-10-05 16:12:08+00:00)
Title: [DO NOT MERGE] Feature: #4, services as rpc api

# Services as RPC services

This is a PoC for #4

## Usage

1. Define your own service (`Your\Module#getServiceConfig()`):

```php
return array(
'factories' => array(
'my_cool_test_service' => function ($sm) {
return new \My\Awesome\Service($sm->get('cool_stuff'));
},
),
);
```
2. Ma your service in the `kjsencha` config (`Your\Module#getConfig()`):
```php
return array(
'kjsencha' => array(
'direct' => array(
'modules' => array(
// to be removed?
),
'services' => array(
// mapping FQCN (JS-side) to the services that provide the API
'My.test.service' => 'my_cool_test_service',
'Grid' => 'my_cool_test_service',
'Application.direct.Grid' => 'my_cool_test_service',
),
),
'bootstrap' => array(
'default' => array(
'modules' => array(
// hack to produce some actual output. output isn't yet valid though (TBD)
'' => array(
'namespace' => '',
),
),
),
),
),
);
````