本文整理匯總了PHP中NextendForm::getSubform方法的典型用法代碼示例。如果您正苦於以下問題:PHP NextendForm::getSubform方法的具體用法?PHP NextendForm::getSubform怎麽用?PHP NextendForm::getSubform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NextendForm
的用法示例。
在下文中一共展示了NextendForm::getSubform方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: subform
function subform()
{
$response = array();
if (!isset($_POST['data'])) {
echo json_encode(array('error' => 'Post not OK!'));
exit;
}
if (get_magic_quotes_gpc() || nextendIsWordPress()) {
$_POST['data'] = stripslashes($_POST['data']);
}
$data = json_decode($_POST['data'], true);
$configurationXmlFile = rtrim(NextendFilesystem::getBasePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $data['xml'];
if (NextendFilesystem::fileexists($configurationXmlFile)) {
nextendimport('nextend.css.css');
nextendimport('nextend.javascript.javascript');
$css = NextendCSS::getInstance();
$js = NextendJavascript::getInstance();
$js->loadLibrary('dojo');
nextendimport('nextend.form.form');
$form = new NextendForm();
$form->loadArray($data['orig']);
$form->loadArray(array($data['name'] => $data['value']));
$form->loadXMLFile($configurationXmlFile);
ob_start();
$subform = $form->getSubform($data['tab'], $data['name']);
$subform->initAjax($data['control_name']);
echo $subform->renderForm();
echo "<style>";
echo $css->generateAjaxCSS($data['loadedCSS']);
echo "</style>";
$scripts = $js->generateAjaxJs($data['loadedJSS']);
$html = ob_get_clean();
$response = array('html' => $html, 'scripts' => $scripts);
} else {
$response = array('error' => 'Configuration file not found');
}
echo json_encode($response);
exit;
}