Celerik\Ui\Adapters\Symfony
CelerikTwigExtension
final class Celerik\Ui\Adapters\Symfony\CelerikTwigExtension extends AbstractExtension
{{ celerik_assets() }} or {{ celerik_assets(theme: 'material', customTheme: '/css/acme.css') }} — load jQuery and Bootstrap before it. {{ celerik(grid) }} — renders any Celerik component.
Methods
__construct
__construct(string $assetsBaseUrl = '/bundles/celerikui')getFunctions
getFunctions(): arrayrender
render(Component $component): stringassets
assets(?string $baseUrl = null, ?string $nonce = null, string $theme = 'bootstrap', ?string $customTheme = null): stringCelerikUiBundle
final class Celerik\Ui\Adapters\Symfony\CelerikUiBundle extends AbstractBundle
Register in config/bundles.php:
Celerik\Ui\Adapters\Symfony\CelerikUiBundle::class => ['all' => true],Twig: {{ celerik_assets() }} and {{ celerik(grid) }} Assets: php bin/console assets:install (copies public/ to public/bundles/celerikui)
Methods
getPath
getPath(): stringThe package root, so that assets:install finds the prebuilt public/ directory.
loadExtension
loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): voidDoctrineDataSource
final class Celerik\Ui\Adapters\Symfony\DoctrineDataSource implements DataSourceInterface
Data source for a Doctrine ORM query builder, e.g. new DoctrineDataSource($repository->createQueryBuilder('u')->select('u.id, u.name, u.email')).
Plain fields resolve against the root alias (name => u.name); dotted fields are used as-is (a.name). For joined columns shown in a Grid, select them under an alias and map that alias to its DQL path, so the same field name sorts, searches and appears in the rows:
$qb->select('b.id, b.title, a.name AS author')->join('b.author', 'a');
new DoctrineDataSource($qb, fieldMap: ['author' => 'a.name']);Select scalar fields rather than whole entities: rows are returned with getArrayResult().
Methods
__construct
__construct(QueryBuilder $queryBuilder, array $searchable = [], array $fieldMap = [])$searchable: Search fields used when the request does not specify any.
fetch
fetch(DataRequest $request): DataResultDoctrineEventSource
final class Celerik\Ui\Adapters\Symfony\DoctrineEventSource implements EventSourceInterface
Event source for a Doctrine ORM query builder, e.g. new DoctrineEventSource($repository->createQueryBuilder('m'), ['start' => 'startsAt', 'end' => 'endsAt']).
Field values are entity property names on the root alias. Only rows overlapping the requested range are queried; rows are read with getArrayResult().
Methods
__construct
__construct(QueryBuilder $queryBuilder, array $fields = [])between
between(DateRange $range): iterable