Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.
You might want to read an updated version of this page for the current version, PrestaShop 8. Read the updated 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);
}
}