本文整理汇总了PHP中RSFormProHelper::showPreview方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::showPreview方法的具体用法?PHP RSFormProHelper::showPreview怎么用?PHP RSFormProHelper::showPreview使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSFormProHelper
的用法示例。
在下文中一共展示了RSFormProHelper::showPreview方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFields
function getFields()
{
$formId = JRequest::getInt('formId');
$return = array();
$this->_db->setQuery("SELECT p.PropertyValue AS ComponentName, c.*, ct.ComponentTypeName FROM #__rsform_components c LEFT JOIN #__rsform_properties p ON (c.ComponentId=p.ComponentId AND p.PropertyName='NAME') LEFT JOIN #__rsform_component_types ct ON (ct.ComponentTypeId = c.ComponentTypeId) WHERE c.FormId='" . $formId . "' ORDER BY c.Order");
$components = $this->_db->loadObjectList();
$properties = RSFormProHelper::getComponentProperties($components);
foreach ($components as $component) {
$data = $properties[$component->ComponentId];
$data['componentId'] = $component->ComponentId;
$data['componentTypeId'] = $component->ComponentTypeId;
$data['ComponentTypeName'] = $component->ComponentTypeName;
$field = new stdClass();
$field->id = $component->ComponentId;
$field->type_id = $component->ComponentTypeId;
$field->name = $component->ComponentName;
$field->published = $component->Published;
$field->ordering = $component->Order;
$field->preview = RSFormProHelper::showPreview($formId, $field->id, $data);
$field->required = '-';
if (!empty($data['REQUIRED'])) {
$field->required = $data['REQUIRED'] == 'YES';
}
$field->validation = '-';
if (isset($data['VALIDATIONRULE']) && $data['VALIDATIONRULE'] != 'none') {
$field->validation = '<b>' . $data['VALIDATIONRULE'] . '</b>';
}
if (isset($data['VALIDATIONRULE_DATE']) && $data['VALIDATIONRULE_DATE'] != 'none') {
$field->validation = '<b>' . $data['VALIDATIONRULE_DATE'] . '</b>';
}
$return[] = $field;
}
return $return;
}
示例2: RSpreviewComponent
function RSpreviewComponent($formId, $componentId)
{
$data = RSFormProHelper::getComponentProperties($componentId);
return RSFormProHelper::showPreview($formId, $componentId, $data);
}