Gregwar\Formidable\Factory::getForm PHP Method

getForm() public method

Get a form in this factory
public getForm ( $pathOrContent, array $vars = [], $cache = false )
$vars array
    public function getForm($pathOrContent, array $vars = array(), $cache = false)
    {
        $formClass = $this->formClass;
        return $this->inject(new $formClass($pathOrContent, $vars, $cache, $this));
    }

Usage Example

Example #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::getForm