1. Go to this page and download the library: Download alto/importmap 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/ */
alto / importmap example snippets
use Alto\ImportMap\ImportMap;
$map = new ImportMap();
// Add a simple mapping
$map->add('react', 'https://esm.sh/[email protected]');
$map->add('react-dom', 'https://esm.sh/[email protected]');
$map = ImportMap::fromFile(__DIR__ . '/importmap.json');
// You can still add entries dynamically
$map->add('app', '/js/app.js');
use Alto\ImportMap\Renderer\HtmlRenderer;
$renderer = new HtmlRenderer();
// Render the import map script and preload links
echo $renderer->render($map);
// Available globally
$map->add('lodash', 'https://unpkg.com/[email protected]/lodash.js');
// Different version for a specific scope
$map->add(
'lodash',
'https://unpkg.com/[email protected]/lodash.js',
scope: '/legacy/'
);