PHP code example of jul6art / ui-bundle

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

    

jul6art / ui-bundle example snippets


Jul6Art\UiBundle\UiBundle::class => ['all' => true],

$builder
    ->add('email', CustomEmailType::class)
    ->add('phone', CustomPhoneType::class)
    ->add('website', CustomUrlType::class)
    ->add('q', CustomSearchType::class);       // magnifier on the left

$builder
    ->add('total', CustomMoneyType::class, ['currency' => 'CHF', 'scale' => 2])
    ->add('duration', CustomUnitType::class, ['unit' => 'h'])
    ->add('responseTimeHours', CustomCountType::class, ['unit' => 'h']);

$builder->add('file', TabularFileType::class);

$builder->add('technician', AutocompleteEntityType::class, [
    'class' => User::class,
    'choice_label' => 'fullName',
    'autocomplete_url' => '/api/users?roles=ROLE_TECHNICIAN&isActive=true',
    'text_key' => 'fullName',                 // the API field shown in the results (default: name)
    'query_builder' => static fn (UserRepository $r) => $r->activeTechniciansQuery(),
    // 'search_key' => 'search',              // the term's query key (default: search)
    // 'secondary_key' => 'sku',              // appended in parentheses to each result
    // 'depends_on' => '#work_order_customer', 'depends_param' => 'customer',
    // 'order_key' => 'lastName',             // the sort key (default: text_key; 'none' = no order)
]);

$builder->add('reference', InputGroupAddOnType::class, [
    'right_addon' => '<i class="fa-solid fa-hashtag"></i>',
    'right_type'  => 'button',    // icon | button | text — only `button` is focusable
    'right_clickable' => true,
    'right_label' => 'reference.copy', // the button's name: a translation key or a TranslatableInterface
]);