Example #1
0
 /**
  * Gets a attribute of this form element
  * @param string $attribute name of the attribute
  * @param mixed $default value to return when the attribute is not set
  * @return mixed
  */
 public function getAttribute($attribute, $default = null)
 {
     if ($attribute == self::ATTRIBUTE_ACTION) {
         return $this->getAction();
     }
     if ($attribute == self::ATTRIBUTE_METHOD) {
         return $this->getMethod();
     }
     if ($attribute == self::ATTRIBUTE_NAME) {
         return $this->getName();
     }
     return parent::getAttribute($attribute, $default);
 }
Example #2
0
 /**
  * Gets the link of this anchor element
  * @param string $default default link value for when no link is set
  * @return string
  */
 public function getHref($default = null)
 {
     return parent::getAttribute(self::ATTRIBUTE_HREF, $default);
 }
 /**
  * Gets a attribute of this element
  * @param string $attribute name of the attribute
  * @param mixed $default value to return when the attribute is not set
  * @return string the value of the attribute
  */
 public function getAttribute($attribute, $default = null)
 {
     if ($attribute == Field::ATTRIBUTE_NAME) {
         return $this->getName();
     }
     if ($attribute == Field::ATTRIBUTE_VALUE) {
         return $this->getValue();
     }
     return parent::getAttribute($attribute, $default);
 }