PHP code example of spatie / commonmark-wire-navigate
1. Go to this page and download the library: Download spatie/commonmark-wire-navigate 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/ */
spatie / commonmark-wire-navigate example snippets
use League\CommonMark\Environment\Environment;
use League\CommonMark\CommonMarkConverter;
use Spatie\CommonMarkWireNavigate\WireNavigateExtension;
$converter = new CommonMarkConverter($environment);
$converter->getEnvironment()->addExtension(new WireNavigateExtension());
echo $converter->convert('[About](/about)');
// <p><a href="/about" wire:navigate>About</a></p>
/*
* These extensions should be added to the markdown environment. A valid
* extension implements League\CommonMark\Extension\ExtensionInterface
*
* More info: https://commonmark.thephpleague.com/2.4/extensions/overview/
*/
'extensions' => [
Spatie\CommonMarkWireNavigate\WireNavigateExtension::class,
],