public function getControlsFromXML($file) { $xmlControls = new MXMLControls(); $xmlControls->loadFile($file, $this); return $xmlControls->get(); }
private function getControlsFromInclude($node, &$controls, $handleChildren = false) { if ($node) { $attributes = $node->attributes(); if ($attributes['file']) { $fileName = $attributes['file']; $file = $this->path . '/' . $this->processValue($fileName); } elseif ($attributes['component']) { $fileName = $attributes['component']; $file = Manager::getAppPath('components/' . $fileName); } $extension = pathinfo($file, PATHINFO_EXTENSION); if ($extension == 'xml') { $xmlControls = new MXMLControls(); $xmlControls->loadFile($file, $this->context); if ($handleChildren) { $this->handleChildren($controls, $xmlControls->root); } else { foreach ($xmlControls->get() as $c) { $this->getControlFromDOM($c, $node); $controls[] = $c; } } } elseif ($extension == 'php') { include_once $file; $fileName = end(explode('/', $fileName)) ?: $fileName; $className = str_replace('.' . $extension, '', $fileName); $c = new $className(); $this->getControlFromDOM($c, $node); if ($handleChildren) { $controls->addControl($c); } else { $controls[] = $c; } } } }
public function addControlsFromXML($file) { $xmlControls = new MXMLControls(); $xmlControls->loadFile($file, $this); $xmlControls->process(); }
public function setFieldsFromXMLString($xmlString) { $controls = new MXMLControls(); $controls->loadString($xmlString, $this->data); $this->setFields($controls->get('fields')); $this->setButtons($controls->get('buttons')); $this->setValidators($controls->get('validators')); }