tagName = 'frameinstance'; if ($modelId !== null) { $this->setModelId($modelId); } } /** * Set Model Id * * @param string $modelId Model Id * @return \FML\Controls\FrameInstance */ public function setModelId($modelId) { $this->modelId = (string)$modelId; $this->model = null; return $this; } /** * Set Frame Model to use * * @param FrameModel $frameModel Frame Model * @return \FML\Controls\FrameInstance */ public function setModel(FrameModel $frameModel) { $this->model = $frameModel; $this->modelId = ''; return $this; } /** * @see \FML\Renderable::render() */ public function render(\DOMDocument $domDocument) { $xmlElement = parent::render($domDocument); if ($this->model) { $this->model->checkId(); $xmlElement->setAttribute('modelid', $this->model->getId()); } else if ($this->modelId) { $xmlElement->setAttribute('modelid', $this->modelId); } return $xmlElement; } }