public function testSeRetornaVariosAtributosHtml()
 {
     $attribute = new Attributes();
     $attribute->set('href', 'http://www.webdevbr.com.br');
     $attribute->set('class', 'btn btn-success');
     $this->assertEquals('href="http://www.webdevbr.com.br" class="btn btn-success"', $attribute->get());
 }
Beispiel #2
0
 /**
  * Sets an attribute value.
  * Will convert the value to the proper, internal PHP/Modlr data type.
  * Will do a dirty check immediately after setting.
  *
  * @param   string  $key    The attribute key (field) name.
  * @param   mixed   $value  The value to apply.
  * @return  self
  */
 protected function setAttribute($key, $value)
 {
     if (true === $this->isCalculatedAttribute($key)) {
         return $this;
     }
     $this->touch();
     $value = $this->convertAttributeValue($key, $value);
     $this->attributes->set($key, $value);
     $this->doDirtyCheck();
     return $this;
 }