skip to Main Content

How to use array as … type? – PHP

I want to call a method like that: public function to(Address|string ...$addresses) {} I can call it with $obj->to("my-address"). But, when I want to give a list of address, I'm using: $myList = [ "address-1", "address-2" ]; $obj->to($myList); But I…

VIEW QUESTION

Required depends on radio button – PHP

I try to have a required value depends on radio button $builder ->add('radio',ChoiceType::class,[ 'label' => 'My radio button', 'choices'=>[ 'Yes'=>'Yes', "No"=>"No" ], "expanded"=>true, "multiple"=>false, 'required' => true, 'placeholder' => false ]) ->add('file input', FileInputType::class, [ 'label' => 'put your file',…

VIEW QUESTION
Back To Top
Search