1. Go to this page and download the library: Download memran/marwa-module 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/ */
memran / marwa-module example snippets
declare(strict_types=1);
use Marwa\Module\ModuleBuilder;
use Marwa\Module\ModuleRegistry;
use Marwa\Module\ModuleRepository;
$modulesPath = __DIR__ . '/modules';
$cacheFile = __DIR__ . '/storage/cache/modules.php';
$repository = new ModuleRepository($modulesPath, $cacheFile);
$registry = new ModuleRegistry($repository);
$builder = new ModuleBuilder($registry);
$user = $builder->current('user');
$user->slug();
$user->routes('http');
$user->path('views');
$user->migrations();
$user->get('menu'); // custom manifest key
$user->get('permissions', []);
count($registry); // Countable
json_encode($user); // JsonSerializable