mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-27 18:10:42 +00:00
add translation service to container
This commit is contained in:
parent
5db84c0564
commit
caa0e3f139
|
|
@ -24,6 +24,7 @@ use Psr\Http\Server\RequestHandlerInterface;
|
|||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use DI\ContainerBuilder;
|
||||
use Slim\Factory\AppFactory;
|
||||
use Seeddms\Seeddms\Translator;
|
||||
|
||||
final class JsonRenderer { /* {{{ */
|
||||
public function json(
|
||||
|
|
@ -3023,6 +3024,7 @@ final class SeedDMS_TestController { /* {{{ */
|
|||
}
|
||||
|
||||
public function echoData($request, $response, $args) { /* {{{ */
|
||||
$translator = $this->container->get('translator');
|
||||
return $this->renderer->json($response, ['success'=>true, 'message'=>'This is the result of the echo call.', 'data'=>$args['data']]);
|
||||
} /* }}} */
|
||||
|
||||
|
|
@ -3276,6 +3278,9 @@ $container->set('logger', $logger);
|
|||
$container->set('fulltextservice', $fulltextservice);
|
||||
$container->set('notifier', $notifier);
|
||||
$container->set('authenticator', $authenticator);
|
||||
$translator = new Translator($settings);
|
||||
$translator->init();
|
||||
$container->set('translator', $translator);
|
||||
|
||||
$app->setBasePath($settings->_httpRoot."restapi/index.php");
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ if (true) {
|
|||
$container->set('fulltextservice', $fulltextservice);
|
||||
$container->set('notifier', $notifier);
|
||||
$container->set('authenticator', $authenticator);
|
||||
$container->set('translator', $translator);
|
||||
|
||||
if (isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
|
||||
foreach ($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user