367 search results for EasyAdmin

// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function changePublishedStatusAction()
{
// ... lines 11 - 24
}
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
// ... lines 37 - 41
$queryBuilder = $this->createListQueryBuilder(
// ... lines 43 - 46
);
return $this->csvExporter->getResponseFromQueryBuilder(
$queryBuilder,
Genus::class,
'genuses.csv'
);
}
}
See Code Block in Script
// ... lines 1 - 5
use AppBundle\Service\CsvExporter;
class GenusController extends AdminController
{
private $csvExporter;
public function __construct(CsvExporter $csvExporter)
{
$this->csvExporter = $csvExporter;
}
// ... lines 16 - 54
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
// ... lines 37 - 41
$queryBuilder = $this->createListQueryBuilder(
$this->entity['class'],
$sortDirection,
$this->request->query->get('sortField'),
$this->entity['list']['dql_filter']
);
// ... lines 48 - 53
}
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
// ... lines 37 - 41
$queryBuilder = $this->createListQueryBuilder(
$this->entity['class'],
$sortDirection,
$this->request->query->get('sortField'),
// ... line 46
);
// ... lines 48 - 53
}
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
// ... lines 37 - 41
$queryBuilder = $this->createListQueryBuilder(
$this->entity['class'],
// ... lines 44 - 46
);
// ... lines 48 - 53
}
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
$sortDirection = $this->request->query->get('sortDirection');
if (empty($sortDirection) || !in_array(strtoupper($sortDirection), ['ASC', 'DESC'])) {
$sortDirection = 'DESC';
}
$queryBuilder = $this->createListQueryBuilder(
// ... lines 43 - 46
);
// ... lines 48 - 53
}
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
$sortDirection = $this->request->query->get('sortDirection');
if (empty($sortDirection) || !in_array(strtoupper($sortDirection), ['ASC', 'DESC'])) {
$sortDirection = 'DESC';
}
// ... lines 41 - 53
}
}
See Code Block in Script
// ... lines 1 - 7
class GenusController extends AdminController
{
// ... lines 10 - 34
public function exportAction()
{
// ... lines 37 - 53
}
}
See Code Block in Script
// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function exportAction()
{
throw new \RuntimeException('Action for exporting an entity not defined');
}
}
See Code Block in Script
27 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 12
public static function new(string $propertyName, ?string $label = null)
{
return (new self())
// ... lines 16 - 17
// this template is used in 'index' and 'detail' pages
->setTemplatePath('admin/field/votes.html.twig')
// this is used in 'edit' and 'new' pages to edit the field contents
// you can use your own form types too
->setFormType(IntegerType::class)
// ... lines 23 - 24
}
}
See Code Block in Script
24 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 6
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
// ... line 8
class VotesField implements FieldInterface
{
// ... lines 11 - 12
public static function new(string $propertyName, ?string $label = null)
{
return (new self())
->setProperty($propertyName)
->setLabel($label)
->setTemplateName('crud/field/integer')
->setFormType(IntegerType::class)
->addCssClass('field-integer')
->setDefaultColumns('col-md-4 col-xxl-3');
}
}
See Code Block in Script
17 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 7
class VotesField implements FieldInterface
{
// ... lines 10 - 11
public static function new(string $propertyName, ?string $label = null)
{
// TODO: Implement new() method.
}
}
See Code Block in Script
17 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 4
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
// ... lines 6 - 7
class VotesField implements FieldInterface
{
use FieldTrait;
// ... lines 11 - 15
}
See Code Block in Script
// ... lines 1 - 10
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 13 - 17
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
dd($field);
}
}
See Code Block in Script
// ... lines 1 - 8
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
public function supports(FieldDto $field, EntityDto $entityDto): bool
{
return $field->getFieldFqcn() === TextareaField::class;
}
// ... lines 17 - 21
}
See Code Block in Script
// ... lines 1 - 4
use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
// ... line 6
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
// ... lines 9 - 10
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
public function supports(FieldDto $field, EntityDto $entityDto): bool
{
// ... line 15
}
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
// ... line 20
}
}
See Code Block in Script
// ... lines 1 - 12
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 15 - 21
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
// ... line 24
if ($crud?->getCurrentPage() === Crud::PAGE_DETAIL) {
// ... line 26
}
// ... lines 28 - 34
}
}
See Code Block in Script
// ... lines 1 - 4
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
// ... lines 6 - 12
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 15 - 21
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
$crud = $context->getCrud();
if ($crud?->getCurrentPage() === Crud::PAGE_DETAIL) {
return;
}
// ... lines 28 - 34
}
}
See Code Block in Script
// ... lines 1 - 4
use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
// ... lines 6 - 11
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 14 - 20
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
// ... lines 23 - 29
}
}
See Code Block in Script