Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Add getAttribute method to base Element, remove type method
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Jun 10, 2015
1 parent b9f9a48 commit f6d10d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/AdamWathan/Form/Elements/Element.php
Expand Up @@ -18,9 +18,9 @@ protected function removeAttribute($attribute)
unset($this->attributes[$attribute]);
}

public function type()
public function getAttribute($attribute)
{
return $this->attributes['type'];
return $this->attributes[$attribute];
}

public function data($attribute, $value)
Expand Down
2 changes: 1 addition & 1 deletion tests/FormBuilderTest.php
Expand Up @@ -536,7 +536,7 @@ public function testRemoveClass()
public function testGetTypeAttribute()
{
$expected = 'radio';
$result = $this->form->radio('fm-transmission')->type();
$result = $this->form->radio('fm-transmission')->getAttribute('type');
$this->assertEquals($expected, $result);
}

Expand Down

0 comments on commit f6d10d7

Please sign in to comment.