PHP code example of digitalstate / platform-widget-bundle

1. Go to this page and download the library: Download digitalstate/platform-widget-bundle 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/ */

    

digitalstate / platform-widget-bundle example snippets




namespace Gov\Bundle\BlogBundle\Widget;

use Ds\Bundle\WidgetBundle\Widget\Widget;

class LatestPostsWidget extends Widget
{
    public function getTitle()
    {
        return 'Latest Posts';
    }

    public function getContent(array $data = [])
    {
        return '<ul><li><a href="">Post 1</a></li><li><a href="">Post 2</a></li></ul>';
    }
}