robertwesner/simple-mvc-php-demo-bundle

v1.0.0 2025-06-04 18:05 UTC

This package is auto-updated.

Last update: 2025-06-04 18:06:25 UTC


README

Simple Bundle for simple-mvc-php

License: MIT

Small demo bundle that covers custom container configurations.

Installation

Add this package via composer.

composer require robertwesner/simple-mvc-php-demo-bundle

Then include the bundle in your $PROJECT_ROOT$/configurations/bundles.php.

use RobertWesner\SimpleMvcPhpDemoBundle\DemoBundle;
use RobertWesner\SimpleMvcPhpDemoBundle\DemoBundleConfiguration;

Configuration::BUNDLES
    ::load(
        DemoBundle::class,
        new DemoBundleConfiguration(
            greeting: 'Hello',
        ),
    );

Usage

DemoInterface can now be autowired from the container.

use RobertWesner\SimpleMvcPhpDemoBundle\Demo\DemoInterface;

final readonly class GreetingService
{
    public function __construct(
        private DemoInterface $demo,
    ) {}
    
    public function doGreet(): void
    {
        print $this->demo->greetWorld();
    }
}