Overview
  • Namespace
  • Class

Namespaces

  • Slim
    • Exception
    • Handlers
      • Strategies
    • Http
    • Interfaces
      • Http

Classes

  • App
  • CallableResolver
  • Collection
  • Container
  • DefaultServicesProvider
  • DeferredCallable
  • Routable
  • Route
  • RouteGroup
  • Router

Traits

  • CallableResolverAwareTrait
  • MiddlewareAwareTrait

Class Container

Slim's default DI container is Pimple.

Slim\App expects a container that implements Psr\Container\ContainerInterface with these service keys configured and ready for use: - settings: an array or instance of \ArrayAccess - environment: an instance of \Slim\Interfaces\Http\EnvironmentInterface - request: an instance of \Psr\Http\Message\ServerRequestInterface - response: an instance of \Psr\Http\Message\ResponseInterface - router: an instance of \Slim\Interfaces\RouterInterface - foundHandler: an instance of \Slim\Interfaces\InvocationStrategyInterface - errorHandler: a callable with the signature: function($request, $response, $exception) - notFoundHandler: a callable with the signature: function($request, $response) - notAllowedHandler: a callable with the signature: function($request, $response, $allowedHttpMethods) - callableResolver: an instance of \Slim\Interfaces\CallableResolverInterface

Pimple\Container
Extended by Slim\Container implements Interop\Container\ContainerInterface
Namespace: Slim
Located at Container.php

Methods summary

public
# __construct( array $values = [] )

Create new container

Create new container

Parameters

$values
The parameters or objects.
public mixed
# get( string $id )

Finds an entry of the container by its identifier and returns it.

Finds an entry of the container by its identifier and returns it.

Parameters

$id
Identifier of the entry to look for.

Returns

mixed
Entry.

Throws

Slim\Exception\ContainerValueNotFoundException
No entry was found for this identifier.
Interop\Container\Exception\ContainerException
Error while retrieving the entry.
public boolean
# has( string $id )

Returns true if the container can return an entry for the given identifier. Returns false otherwise.

Returns true if the container can return an entry for the given identifier. Returns false otherwise.

Parameters

$id
Identifier of the entry to look for.

Returns

boolean
public
# __get( $name )
public
# __isset( $name )
API documentation generated by ApiGen