PHP code example of t4web / default-service

1. Go to this page and download the library: Download t4web/default-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

t4web / default-service example snippets



return array(
  'modules' => array(
      // ...
      'T4web\DefaultService',
  ),
  // ...
);

'invokables' => [
    CreateAction\ChangesValidator::class => CreateAction\ChangesValidator::class,
    API\AddFriend\ViewModel::class => API\AddFriend\ViewModel::class,
    API\RemoveFriend\ViewModel::class => API\RemoveFriend\ViewModel::class,
    API\CreateFriendRequest\ViewModel::class => API\CreateFriendRequest\ViewModel::class,
    API\UpdateFriendRequest\ViewModel::class => API\UpdateFriendRequest\ViewModel::class,
    // ...
],

'factories' => [
    Domain\User\MySelf::class => Domain\User\MySelfFactory::class,
    Domain\User\Service\Creator::class => Domain\User\Service\CreatorFactory::class,
    Domain\User\Service\Updater::class => Domain\User\Service\UpdaterFactory::class,
    API\AddFriend\ChangesValidator::class => API\AddFriend\ChangesValidatorFactory::class,
    API\RemoveFriend\CriteriaValidator::class => API\RemoveFriend\CriteriaValidatorFactory::class,
    API\RemoveFriend\RemoveService::class => API\RemoveFriend\RemoveServiceFactory::class,
    API\CreateFriendRequest\CriteriaValidator::class => API\CreateFriendRequest\CriteriaValidatorFactory::class,
    API\CreateFriendRequest\Service::class => API\CreateFriendRequest\ServiceFactory::class,
    API\UpdateFriendRequest\CriteriaValidator::class => API\UpdateFriendRequest\CriteriaValidatorFactory::class,
    API\UpdateFriendRequest\Service::class => API\UpdateFriendRequest\ServiceFactory::class,
    Frontend\ShowUser\ViewModel::class => Frontend\ShowUser\ViewModelFactory::class,
    Frontend\Friends\Service::class => Frontend\Friends\ServiceFactory::class,
    Frontend\Friends\ViewModel::class => Frontend\Friends\ViewModelFactory::class,
    Backend\LoginAs\Service::class => Backend\LoginAs\ServiceFactory::class,
    Friend\Listener\FriendRequestAccept::class => Friend\Listener\FriendRequestAcceptFactory::class,
],
bash
$ php composer.phar update