Pop\Form\Form::setAttributes PHP Method

setAttributes() public method

Set an attribute or attributes for the form object.
public setAttributes ( array | string $a, string $v = null ) : Form
$a array | string
$v string
return Form
    public function setAttributes($a, $v = null)
    {
        $this->form->setAttributes($a, $v);
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: FormTest.php プロジェクト: nicksagona/PopPHP
 public function testSetAndGetAttributes()
 {
     $f = new Form('/submit', 'post');
     $f->setAttributes('id', 'test-form');
     $this->assertEquals(3, count($f->getAttributes()));
 }