Eccube\Form\Type\Admin\CacheType::buildForm PHP Method

buildForm() public method

public buildForm ( Symfony\Component\Form\FormBuilderInterface $builder, array $options )
$builder Symfony\Component\Form\FormBuilderInterface
$options array
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        // 対象となるキャッシュディレクトリを取得
        // eccubeディレクトリは削除対象外とする
        $finder = Finder::create()->notName('eccube')->depth(0);
        $cacheDir = $this->config['root_dir'] . '/app/cache';
        $cacheDirs = array();
        foreach ($finder->in($cacheDir) as $file) {
            $cacheDirs[$file->getFilename()] = $file->getFilename();
        }
        $builder->add('cache', 'choice', array('label' => 'キャッシュディレクトリ', 'choices' => $cacheDirs, 'expanded' => true, 'multiple' => true, 'required' => true, 'data' => array('twig'), 'constraints' => array(new Assert\NotBlank())));
    }