1. Go to this page and download the library: Download 2lenet/dashboard2-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/ */
2lenet / dashboard2-bundle example snippets
use Lle\DashboardBundle\Widgets\AbstractWidget;
public function render()
{
return $this->twig("widget/pasta_widget.html.twig", [
"data" => $data,
]);
}
public function render()
{
return $this->twig("widget/pasta_widget.html.twig", [
"data" => $data,
"exportable" => false
]);
}
public function render()
{
$form = $this->createForm(InterventionWidgetType::class);
return $this->twig("widget/cake_widget.html.twig", [
"data" => $data,
"config_form" => $form->createView()
]);
}
class InterventionWidgetType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('etat', ChoiceType::class, [
'choices' => $yourChoices
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}
public function getCacheKey(): string
{
return $this->getId() . "_" .md5($this->config);
}
public function getCacheTimeout(): int
{
return 300;
}
public function getChartList(): array
{
return [
'COUNTSOMETHING-DAY-30',
'COUNTSOMETHING-DAY-60',
'COUNTSOMETHING-MONTH-12',
'COUNTSOMETHING-MONTH-24',
'SUMSOMETHING-DAY-30',
'SUMSOMETHING-DAY-60',
'SUMSOMETHING-MONTH-12',
'SUMSOMETHING-YEAR-1'
];
}