attribute = $attribute; $this->from = $from; $this->to = $to; $this->duration = $duration; $this->begin = $begin; } /** * Create the SVG representation from this Drawable * * @param RenderContext $ctx The context to use for rendering * @return DOMElement The SVG Element */ public function toSvg(RenderContext $ctx) { $animate = $ctx->getDocument()->createElement('animate'); $animate->setAttribute('attributeName', $this->attribute); $animate->setAttribute('attributeType', 'XML'); $animate->setAttribute('from', $this->from); $animate->setAttribute('to', $this->to); $animate->setAttribute('begin', $this->begin . 's'); $animate->setAttribute('dur', $this->duration . 's'); $animate->setAttributE('fill', "freeze"); return $animate; } }