Notice: You are browsing the documentation for PrestaShop 9, which is currently in development.
You might want to read the documentation for the current version, PrestaShop 8. Read the current version of this page
CountryChoiceType is a child of ChoiceType. It is used to display countries selection box and by default comes with a list of countries from PrestaShop database.
Option | Type | Default value | Description | |
---|---|---|---|---|
choices | array | Array of all available countries | Choice list that is passed to parent ‘choices’. Array should be formatted in name => value pairs. |
None.
<?php
// path/to/your/CustomType.php
use PrestaShopBundle\Form\Admin\Type\CountryChoiceType;
use Symfony\Component\Form\AbstractType;
class CustomType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('country', CountryChoiceType::class);
}
}