Form/SkinType.php
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        global $kernel;

        // get all modules
        $modules = array();

        $dir = $kernel->getRootDir().'/../src/Terrific/Module/';

        $finder = new Finder();
        $finder->directories()->in($dir)->depth('== 0');

        foreach ($finder as $file) {
            $filename = $file->getFilename();
            $module = str_replace('Bundle', '', $filename);
            $modules[$module] = $module;
        }

        $builder->add('module', 'choice', array(
            'choices' => $modules,
            'multiple' => false,
            'label' => 'Skin for Module'
        ));
        $builder->add('name', 'text');
        $builder->add('style', 'choice', array(
            'choices' => array('css' => 'CSS', 'less' => 'LESS'),
            'multiple' => false,
            'expanded' => true
        ));
    }
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        global $kernel;

        // get all modules
        $modules = array();

        $dir = $kernel->getRootDir().'/../src/Terrific/Module/';

        $finder = new Finder();
        $finder->directories()->in($dir)->depth('== 0');

        foreach ($finder as $file) {
            $filename = $file->getFilename();
            $module = str_replace('Bundle', '', $filename);
            $modules[$module] = $module;
        }

        $builder->add('module', 'choice', array(
            'choices' => $modules,
            'multiple' => false,
            'label' => 'Skin for Module'
        ));
        $builder->add('name', 'text');
        $builder->add('style', 'choice', array(
            'choices' => array('css' => 'CSS', 'less' => 'LESS'),
            'multiple' => false,
            'expanded' => true
        ));
    }
public function buildForm ( FormBuilderInterface $ builder , array $ options ) { global $ kernel ; // get all modules $ modules = array ( ) ; $ dir = $ kernel -> getRootDir ( ) . '/../src/Terrific/Module/' ; $ finder = new Finder ( ) ; $ finder -> directories ( ) -> in ( $ dir ) -> depth ( '== 0' ) ; foreach ( $ finder as $ file ) { $ filename = $ file -> getFilename ( ) ; $ module = str_replace ( 'Bundle' , '' , $ filename ) ; $ modules [ $ module ] = $ module ; } $ builder -> add ( 'module' , 'choice' , array ( 'choices' => $ modules , 'multiple' => false , 'label' => 'Skin for Module' ) ) ; $ builder -> add ( 'name' , 'text' ) ; $ builder -> add ( 'style' , 'choice' , array ( 'choices' => array ( 'css' => 'CSS' , 'less' => 'LESS' ) , 'multiple' => false , 'expanded' => true ) ) ; }
Builds the Skin form.

@param \Symfony\Component\Form\FormBuilder $builder
@param array $options
Builds the Skin form .