/** * Get an attribute value from this image tag * @param string $attribute name of the attribute * @param mixed $default default value for when the attribute is not set (default null) * @return mixed value of the attribute if set, default value otherwise */ public function getAttribute($attribute, $default = null) { if ($attribute == self::ATTRIBUTE_SRC) { return $this->getSource(); } return parent::setAttribute($attribute, $default); }
/** * 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 the HTML of the method attribute * @return string */ protected function getMethodHtml() { return parent::getAttributeHtml(self::ATTRIBUTE_METHOD, $this->method); }
/** * 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); }