Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Symfony UX Autocompleteとかいう
顧客が本当に必要だったもの

Symfony UX Autocompleteとかいう
顧客が本当に必要だったもの

PHPerのための「Symfonyを語り合う」PHP TechCafe のLT資料です。
https://rakus.connpass.com/event/285602/

同様の内容をブログ記事としても公開済みです。
https://zenn.dev/ttskch/articles/dc3c09b71f73d4

Takashi Kanemoto

June 27, 2023
Tweet

More Decks by Takashi Kanemoto

Other Decks in Programming

Transcript

  1. / 29 Symfony UX Autocomplete 
 2 023 / 06

    / 2 7 #PHPTechCafe @ttskch 1
  2. / 29 class User { // ... public function __toString():

    string { return sprintf('%s %s', $this->team, $this->name); } } 9 EntityType N+ 1
  3. / 29 $builder ->add('user', EntityType::class, [ 'class' => User::class, 'placeholder'

    => 'બ୒͍ͯͩ͘͠͞', 'query_builder' => function (UserRepository $repository) { return $repository->createQueryBuilder('u') ->leftJoin('u.team', 't') ->addSelect('t') ; }, ]) ; 14
  4. / 29 #[AsEntityAutocompleteField] class UserAutocompleteField extends AbstractType { public function

    configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => User::class, 'placeholder' => 'ݕࡧ͍ͯͩ͘͠͞', ]); } public function getParent(): string { return ParentEntityAutocompleteType::class; } } 21 🙏 FormType
  5. / 29 26 JavaScript Tom Select Tom Select FormType ⾒

    JavaScript 
 Tom Select 
 🙏