W3cubDocs

/CakePHP 4.4

Interface ContainerApplicationInterface

Interface for applications that configure and use a dependency injection container.

Namespace: Cake\Core

Method Summary

  • getContainer() public

    Create a new container and register services.

  • services() public

    Register services to the container

Method Detail

getContainer() public

getContainer(): Cake\Core\ContainerInterface

Create a new container and register services.

This will register() services provided by both the application and any plugins if the application has plugin support.

Returns

Cake\Core\ContainerInterface

services() public

services(Cake\Core\ContainerInterface $container): void

Register services to the container

Registered services can have instances fetched out of the container using get(). Dependencies and parameters will be resolved based on service definitions.

Parameters

Cake\Core\ContainerInterface $container

The container to add services to

Returns

void

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/interface-Cake.Core.ContainerApplicationInterface.html