1. Go to this page and download the library: Download klsoft/yii3-swoole 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/ */
klsoft / yii3-swoole example snippets
use Yiisoft\Aliases\Aliases;
use Yiisoft\Assets\AssetManager;
use Yiisoft\Assets\AssetLoaderInterface;
use Yiisoft\Assets\AssetConverterInterface;
use Yiisoft\Assets\AssetRegistrar;
return [
// ...
AssetManager::class => [
'definition' => static function (ContainerInterface $container) use ($params): AssetManager {
$assetManager = new AssetManager(
$container->get(Aliases::class),
$container->get(AssetLoaderInterface::class),
$params['yiisoft/assets']['assetManager']['allowedBundleNames'],
$params['yiisoft/assets']['assetManager']['customizedBundles'],
);
$assetManager = $assetManager
->withConverter($container->get(AssetConverterInterface::class));
if ($params['yiisoft/assets']['assetManager']['publisher'] !== null) {
$assetManager = $assetManager->withPublisher(
$container->get($params['yiisoft/assets']['assetManager']['publisher'])
);
}
$assetManager->registerMany($params['yiisoft/assets']['assetManager']['register']);
return $assetManager;
},
'reset' => function (ContainerInterface $container) {
$this->registrar = new AssetRegistrar($container->get(Aliases::class), $container->get(AssetLoaderInterface::class));
},
],
];