/** * Process to the default render of the given element. The element must implement Drawable * @param Element $element * @param array $options * @return mixed * @throws \UForm\Exception */ public function elementDefaultRender(Element $element, $options = []) { if ($element instanceof Element\Drawable) { $navigator = new Navigator(); $value = $navigator->arrayGet($this->formContext->getData()->getDataCopy(), $element->getName(true, true), 1); return $element->render($value, $options); } else { throw new \UForm\Exception('Trying to render an invalid element. Element not implementing Drawable cant be rendered'); } }
/** * The local name, it matches the name of the data in the local data * @return mixed|null|string */ public function getLocalName() { return $this->element->getName(); }