Files
Phraseanet/lib/Alchemy/Phrasea/PhraseanetService/Provider/PSExposeServiceProvider.php
2020-09-15 14:59:34 +03:00

52 lines
1.3 KiB
PHP

<?php
namespace Alchemy\Phrasea\PhraseanetService\Provider;
use Alchemy\Phrasea\Application as PhraseaApplication;
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
use Alchemy\Phrasea\PhraseanetService\Controller\PSExposeController;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Silex\ServiceProviderInterface;
class PSExposeServiceProvider implements ControllerProviderInterface, ServiceProviderInterface
{
use ControllerProviderTrait;
/**
* @inheritDoc
*/
public function register(Application $app)
{
$app['controller.ps.expose'] = $app->share(function (PhraseaApplication $app) {
return new PSExposeController($app);
});
}
/**
* @inheritDoc
*/
public function connect(Application $app)
{
$controllers = $this->createAuthenticatedCollection($app);
$controllers->match('/create-publication/', 'controller.ps.expose:createPublicationAction')
->method('POST')
->bind('ps_expose_create_publication');
$controllers->match('/list-publication/', 'controller.ps.expose:listPublicationAction')
->method('GET')
->bind('ps_expose_list_publication');
return $controllers;
}
/**
* @inheritDoc
*/
public function boot(Application $app)
{
}
}