PHP code example of veloxia / markup

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

    

veloxia / markup example snippets

 php
'providers' => [
    ...
    Veloxia\Markup\MarkupServiceProvider::class,
    ...
];

'aliases' => [
    ...
    'Markup' => Veloxia\Markup\Facades\Markup::class,
    ...
];

 html
<script type="application/ld+json">
{
    "@context": "https:\/\/schema.org",
    "@type": "FAQPage",
    "mainEntity": [
        {
            "@type": "Question",
            "name": "Sunt in culpa qui officia deserunt?",
            "acceptedAnswer": {
                "@type": "Answer",
                "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
            }
        },
        {
            "@type": "Question",
            "name": "Casus mixtus cum culpa?",
            "acceptedAnswer": {
                "@type": "Answer",
                "text": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
            }
        }
    ]
}
</script>
 php
// Just one Q/A pair at a time ...
$markup->question("Question here", "Answer here")->json();

// ... or a bigger array
$faq = (new \Veloxia\Markup\Generators\FAQ([
    "Question 1" => "Answer A",
    "Question 2" => "Answer B",
]))->json();