1. Go to this page and download the library: Download tacman/dictionary-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/ */
tacman / dictionary-bundle example snippets
$bundles = array(
// ...
new Knp\DictionaryBundle\KnpDictionaryBundle(),
);
private Dictionary $myDictionary;
public function __construct(
\Knp\DictionaryBundle\Dictionary\Collection $dictionaries)
{
$this->myDictionary = $dictionaries['my_dictionary'];
}
use Knp\DictionaryBundle\Form\Type\DictionaryType;
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('civility', DictionaryType::class, array(
'name' => 'my_dictionary'
))
;
}
use Knp\DictionaryBundle\Validator\Constraints\Dictionary;
class User
{
/**
* @ORM\Column
* @Dictionary(name="my_dictionary")
*/
private $civility;
}
bash
composer install
vendor/bin/php-cs-fixer fix
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.