Pop\Form\Form::factory PHP Method

factory() public static method

Static method to instantiate the form object and return itself to facilitate chaining methods together.
public static factory ( string $action = null, string $method = 'post', array $fields = null, string $indent = null ) : Form
$action string
$method string
$fields array
$indent string
return Form
    public static function factory($action = null, $method = 'post', array $fields = null, $indent = null)
    {
        return new self($action, $method, $fields, $indent);
    }

Usage Example

Example #1
0
 public function testConstructor()
 {
     $this->assertInstanceOf('Pop\\Form\\Form', new Form('/submit', 'post'));
     $this->assertInstanceOf('Pop\\Form\\Form', Form::factory('/submit', 'post'));
 }