PHP code example of websonette / web-application

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

    

websonette / web-application example snippets


use Websonette\WebApplication\Breadcrumbs\Breadcrumbs;

$breadcrumbs = new Breadcrumbs();
$breadcrumbs->add('Homepage', '/', 'home', 'Introduction');
$breadcrumbs->add('Products', '/products', 'box');

use Websonette\WebApplication\Page\PageContext;

$page = (new PageContext())
    ->setTitle('Products')
    ->setHeading('Our products')
    ->setDescription('Product overview')
    ->setCanonicalUrl('https://example.com/products')
    ->addAlternateUrl('cs', 'https://example.com/cs/produkty')
    ->setProperty('og:title', 'Products');