Gregwar\Formidable\Factory::registerType PHP Méthode

registerType() public méthode

Register a type
public registerType ( $type, $class )
    public function registerType($type, $class)
    {
        $this->typeClasses[$type] = $class;
    }

Usage Example

Exemple #1
0
 /**
  * Testing adding a customized type
  */
 public function testFactoryCustomType()
 {
     $factory = new Factory();
     $factory->registerType('testing', '\\Gregwar\\Formidable\\Fields\\TextField');
     $form = $factory->getForm(__DIR__ . '/files/factory/testing.html');
     $html = "{$form}";
     $this->assertContains('text', $html);
     $this->assertEquals('Hello', $form->test);
 }
All Usage Examples Of Gregwar\Formidable\Factory::registerType