PHP code example of hasnayeen / mdb

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

    

hasnayeen / mdb example snippets


$content = '
# Welcome to my blog

<x-alert type="success">
This is a success message.
</x-alert>

<x-alert type="warning">
This is a warning message.
</x-alert>

<x-alert type="danger">
This is a danger message.
</x-alert>
';

Mdb::render($content);

Str::mdb($content);

$content = '# MDB Demo';
$config = [
    'html_input' => 'allow',
    'allow_unsafe_links' => true,
    'max_nesting_level' => 4,
    'renderer' => 'block_separator',
];
Mdb::render($content, $config);

    'extensions' => [
        'League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension',
    ]

$content = '# MDB Demo';
$config = [
    'heading_permalink' => [
        'html_class' => 'heading-permalink',
        'id_prefix' => 'content',
        'apply_id_to_heading' => false,
        'heading_class' => '',
        'fragment_prefix' => 'content',
        'insert' => 'before',
        'min_heading_level' => 1,
        'max_heading_level' => 6,
        'title' => 'Permalink',
        'symbol' => '#',
        'aria_hidden' => true,
    ],
];
Mdb::render($content, $config);
html
<!-- resources/views/components/alert.blade.php -->

@props(['type' => 'info'])

<div {{ $attributes->merge(['class' => "alert alert-{{ $type }}"]) }}>
    {{ $slot }}
</div>