コード例 #1
0
ファイル: AttributesTest.php プロジェクト: objective-php/html
 public function testMultiValuesAttributes()
 {
     $values = new Collection(['a', 'b']);
     $attribs = new Attributes(['x' => $values]);
     $this->assertInstanceOf(Collection::class, $attribs['x']);
     $this->assertSame($values, $attribs['x']);
     $attribs->set('x', $otherValues = new Collection(['y', 'z']));
     $this->assertInstanceOf(Collection::class, $attribs['x']);
     $this->assertSame($values, $attribs['x']);
 }
コード例 #2
0
ファイル: Tag.php プロジェクト: objective-php/html
 /**
  * @param $attribute
  *
  * @return mixed|null
  * @throws \ObjectivePHP\Primitives\Exception
  */
 public function getAttribute($attribute)
 {
     return $this->attributes->get($attribute);
 }