PHP code example of kalamu / dashboard-bundle

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

    

kalamu / dashboard-bundle example snippets

 php
    public function registerBundles()
    {
        $bundles = array(
            // [...]
            new Bazinga\Bundle\JsTranslationBundle\BazingaJsTranslationBundle(),
            new Kalamu\DashboardBundle\KalamuDashboardBundle(),
        );
 php
use Kalamu\DashboardBundle\Model\AbstractConfigurableElement;
use Symfony\Bundle\TwigBundle\TwigEngine;
use Symfony\Component\Form\Form;

class UserDueTasks extends AbstractConfigurableElement
{

    public function getTitle()
    {
        return 'My lasts tasks';
    }

    public function getDescription()
    {
        return 'Display my last assigned tasks with they due time.';
    }

    public function getForm(Form $form)
    {
        $form->add("number", 'integer', [
            'label' => 'Number of task to show',
            'data'  => 10
        ]);
        return $form;
    }

    public function render(TwigEngine $templating){
        $number = $this->parameters['number'];

        $tasks = $this->theMagicOne($number); // Here you call your magic method that get the last '$number' tasks of the current user

        return $templating->render('AcmeAppBundle:Element:user_due_tasks.html.twig',
            ['tasks' => $tasks, 'number' => $number]);
    }

}