2017 © Pedro Peláez
 

library kohana-pimple

Kohana PHP Framework module for the Pimple dependency injection container

image

rjd22/kohana-pimple

Kohana PHP Framework module for the Pimple dependency injection container

  • Wednesday, July 29, 2015
  • by rjd22
  • Repository
  • 0 Watchers
  • 2 Stars
  • 689 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 39 % Grown

The README.md

Kohana Pimple Module

Build Status, (*1)

Pimple dependency injection container for the Kohana framework., (*2)

Installation

To use this module simply require this module with composer:, (*3)

composer require rjd22/kohana-pimple:"~1.0"

Then add the module to the kohana modules list in your application/bootstrap.php. Make sure you have a MODPATH or a vendor path that points to the composer vendor folder., (*4)

Configuration

You have register dependency config files with the pimple container. These config files are similar to the config files that kohana uses but it's required to register the full path in the config/pimple.php., (*5)

A sample of a dependency config file:, (*6)

return [
    'dependency.one' => function ($c) {
        return new Dependency\One;
    },
    'dependency.two' => function ($c) {
        return new Dependency\Two($c['dependency.one']);
    },
];

Usage

You can use this dependency injection container by extending the your controllers with the Kohana\Pimple\Controller\ContainerAwareController this will enable you to access the container by calling the following to check if a dependency exists:, (*7)

$this->container->has('dependency.one');

And the following to get the dependency:, (*8)

$this->container->get('dependency.one');

If you don't like extending the controller you can also build the container yourself by calling:, (*9)

$container = Container::factory();

The Versions

29/07 2015

dev-master

9999999-dev

Kohana PHP Framework module for the Pimple dependency injection container

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert-Jan de Dreu

29/07 2015

1.0.1

1.0.1.0

Kohana PHP Framework module for the Pimple dependency injection container

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert-Jan de Dreu

29/07 2015

1.0.0

1.0.0.0

Kohana PHP Framework module for the Pimple dependency injection container

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert-Jan de Dreu