1. Go to this page and download the library: Download survos/kit-bundle 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/ */
survos / kit-bundle example snippets
use Survos\Kit\AbstractSurvosBundle;
use Survos\Kit\Traits\HasDoctrineEntities;
final class SurvosMyBundle extends AbstractSurvosBundle
{
use HasDoctrineEntities;
protected function doctrineAlias(): string
{
return 'My';
}
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
{
parent::loadExtension($config, $container, $builder); // auto-scans Command/, Controller/
// Only register services that need non-default arguments
$container->services()
->set(MyService::class)
->arg('$config', $config);
}
}
use Symfony\Component\DependencyInjection\Kernel\RequiredBundle;
use Survos\Kit\SurvosKitBundle;
#[RequiredBundle(SurvosKitBundle::class)]
final class SurvosMyBundle extends AbstractSurvosBundle { ... }
use Survos\Kit\AbstractSurvosBundle;
use Survos\Kit\Traits\HasDoctrineEntities;
final class SurvosMyBundle extends AbstractSurvosBundle
{
use HasDoctrineEntities;
}
// ✅ After: conventions replace boilerplate
final class SurvosMyBundle extends AbstractSurvosBundle
{
use HasDoctrineEntities;
use HasConfigurableRoutes;
// Doctrine + Twig handled by the base class
protected function doctrineAlias(): string { return 'My'; }
public function configure(DefinitionConfigurator $definition): void
{
$children = $definition->rootNode()->children();
$this->addRouteOptions($children, '/my');
$children->end();
}
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
{
parent::loadExtension($config, $container, $builder); // scans Command/, Controller/
$this->captureRouteConfig($config);
$this->registerRouteLoader($builder);
// Only wire services that need arguments
$container->services()
->set(MyService::class)
->arg('$config', $config);
}
public function build(ContainerBuilder $container): void
{
parent::build($container);
$this->addRouteLoaderCompilerPass($container);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.