PHP code example of jefero / bot_common

1. Go to this page and download the library: Download jefero/bot_common 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/ */

    

jefero / bot_common example snippets

 
class Kernel extends BaseKernel
{
    //Path to library
    private const COMMON_PATH = 'vendor/jefero/bot_common';

    use MicroKernelTrait;

    //Import bot containers
    protected function configureContainer(ContainerConfigurator $container): void
    {
        $container->import('../' . self::COMMON_PATH . '/config/{packages}/*.yaml');
        $container->import('../' . self::COMMON_PATH . '/config/{packages}/' . (string)$this->environment . '/*.yaml');
        $container->import('../' . self::COMMON_PATH . '/config/services.yaml');
        $container->import('../' . self::COMMON_PATH . '/config/{services}_' . (string)$this->environment . '.yaml');

        //...other settings
    }

    //Import bot routes
    protected function configureRoutes(RoutingConfigurator $routes): void
    {

        $routes->import('../' . self::COMMON_PATH . '/config/{routes}/' . (string)$this->environment . '/*.yaml');
        $routes->import('../' . self::COMMON_PATH . '/config/{routes}/*.yaml');

        //...other settings
    }

    //Add method for register bot bundles
    public function registerBundles(): iterable
    {
        /** @psalm-suppress UnresolvableInclude */
        $commonBundles = 

parameters:
    jefero_common_dir: '%kernel.project_dir%/vendor/jefero/bot_common'
    #...other params