本文整理汇总了PHP中HTML_QuickForm2_Renderer::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm2_Renderer::factory方法的具体用法?PHP HTML_QuickForm2_Renderer::factory怎么用?PHP HTML_QuickForm2_Renderer::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_QuickForm2_Renderer
的用法示例。
在下文中一共展示了HTML_QuickForm2_Renderer::factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toString
public function __toString()
{
if ($this->frozen) {
return $this->getFrozenHtml();
} else {
require_once 'HTML/QuickForm2/Renderer.php';
return $this->render(HTML_QuickForm2_Renderer::factory('default')->setTemplateForId($this->getId(), "<table class=\"dualselect\" id=\"{id}\">\n" . " <tr>\n" . " <td style=\"vertical-align: top;\">{select_from}</td>\n" . " <td style=\"vertical-align: middle;\">{button_from_to}<br />{button_to_from}</td>\n" . " <td style=\"vertical-align: top;\">{select_to}</td>\n" . " </tr>\n" . "</table>"))->__toString();
}
}
示例2: createForm
function createForm($form)
{
HTML_QuickForm2_Renderer::register('smarty', 'HTML_QuickForm2_Renderer_Smarty');
$renderer = HTML_QuickForm2_Renderer::factory('smarty');
$renderer->setOption('old_compat', true);
$renderer->setOption('group_errors', true);
// フォームの作成
$FormData = $form->render($renderer)->toArray();
$this->smarty->assign('form', $FormData);
$this->smarty->display('login.html');
}
示例3: testGroupHiddens
public function testGroupHiddens()
{
$form = new HTML_QuickForm2('testGroupHiddens', 'post', null, false);
$hidden = $form->addHidden('aHiddenElement');
$renderer = HTML_QuickForm2_Renderer::factory('stub');
$renderer->setOption('group_hiddens', false);
$form->render($renderer);
$this->assertEquals(array(), $renderer->getHidden());
$renderer->setOption('group_hiddens', true);
$form->render($renderer);
$this->assertEquals(array($hidden->__toString()), $renderer->getHidden());
}
示例4: createForm
function createForm($form, $add_data = NULL)
{
// smartyインスタンス作成
$smarty = $this->getSmarty();
HTML_QuickForm2_Renderer::register('smarty', 'HTML_QuickForm2_Renderer_Smarty');
$renderer = HTML_QuickForm2_Renderer::factory('smarty');
$renderer->setOption('old_compat', true);
// フォームの作成
$FormData = $form->render($renderer)->toArray();
$smarty->assign('data', $add_data);
$smarty->assign('form', $FormData);
$smarty->display('search.html');
}
示例5: renderForm
function renderForm($addHidden)
{
$this->initPossibleConditions();
$t = new Am_View();
$renderer = HTML_QuickForm2_Renderer::factory('array');
if (!$this->form) {
$this->createForm(array());
}
$this->form->render($renderer);
$t->assign('form', $renderer->toArray());
$t->assign('description', $this->getDescription(true));
$t->assign('serialized', $this->serialize());
$t->assign('hidden', $addHidden);
$t->assign('loadSearchOptions', Am_Controller::renderOptions($this->getLoadOptions(), $this->saved_search_id));
return $t->render($this->template);
}
示例6: toString
function toString($tpl)
{
$renderer = \HTML_QuickForm2_Renderer::factory('larakit_form');
$this->render($renderer);
larajs()->addInline($renderer->getJavascriptBuilder()->getFormJavascript($this->getId(), false));
return \View::make($tpl, ['is_submited' => (bool) $this->isSubmitted(), 'form' => $renderer->toArray(), 'meta' => \Larakit\QuickForm\Register::$elements])->__toString();
}
示例7: edit
/**
* edit edits the entry
*
* @return string html-string
*/
private function edit()
{
// smarty-templates
$sD = new JudoIntranetSmarty();
// check rights
if (Rights::check_rights($this->get('cid'), 'calendar')) {
// check cid and pid given
if ($this->get('cid') !== false && $this->get('pid') !== false) {
// check cid and pid exists
if (Calendar::check_id($this->get('cid')) && Preset::check_preset($this->get('pid'), 'calendar')) {
// pagecaption
$this->tpl->assign('pagecaption', parent::lang('class.AnnouncementView#page#caption#edit'));
// prepare return
$return = '';
// get preset
$preset = new Preset($this->get('pid'), 'calendar', $this->get('cid'));
// get fields
$fields = $preset->get_fields();
// formular
$form = new HTML_QuickForm2('edit_announcement', 'post', array('name' => 'edit_announcement', 'action' => 'announcement.php?id=edit&cid=' . $this->get('cid') . '&pid=' . $this->get('pid')));
// values
$datasource = array();
foreach ($fields as $field) {
// read values
$field->read_value();
// check type
if ($field->get_type() == 'text') {
// check defaults
$datasource['calendar-' . $field->get_id()]['manual'] = '';
$datasource['calendar-' . $field->get_id()]['defaults'] = 0;
if ($field->get_value() == '') {
$datasource['calendar-' . $field->get_id()]['defaults'] = 'd' . $field->get_defaults();
} else {
$datasource['calendar-' . $field->get_id()]['manual'] = $field->get_value();
}
} elseif ($field->get_type() == 'dbhierselect') {
// explode value
list($v_first, $v_second) = explode('|', $field->get_value(), 2);
// set values
$datasource['calendar-' . $field->get_id()][0] = $v_first;
$datasource['calendar-' . $field->get_id()][1] = $v_second;
} elseif ($field->get_type() == 'dbselect') {
// check multiple
if (strpos($field->get_value(), '|') !== false) {
// separate value
$values = explode('|', $field->get_value());
foreach ($values as $i => $value) {
$datasource['calendar-' . $field->get_id()][$i] = $value;
}
} else {
$datasource['calendar-' . $field->get_id()] = $field->get_value();
}
} else {
$datasource['calendar-' . $field->get_id()] = $field->get_value();
}
}
$form->addDataSource(new HTML_QuickForm2_DataSource_Array($datasource));
// renderer
$renderer = HTML_QuickForm2_Renderer::factory('default');
$renderer->setOption('required_note', parent::lang('class.AnnouncementView#entry#form#requiredNote'));
// generate field-quickform and add to form
foreach ($fields as $field) {
// generate quickform
$field_id = $field->read_quickform(array(), true);
// check $field_id
if ($field_id != '' && $field->get_type() == 'date') {
// smarty
$sD->assign('elementid', $field_id . '-0');
$sD->assign('dateFormat', 'yy-mm-dd');
$sD->assign('dateValue', $field->get_value());
$this->add_jquery($sD->fetch('smarty.js-datepicker.tpl'));
}
// add to form
$form->appendChild($field->get_quickform());
}
// submit-button
$form->addSubmit('submit', array('value' => parent::lang('class.AnnouncementView#edit#form#submitButton')));
// validate
if ($form->validate()) {
// get calendar
$calendar = new Calendar($this->get('cid'));
// prepare marker-array
$announcement = array('version' => date('dmy'));
// get data
$data = $form->getValue();
// insert values
foreach ($fields as $field) {
// values to db
$field->value($data[$field->get_table() . '-' . $field->get_id()]);
$field->write_db('update');
}
// add calendar-fields to array
$calendar->add_marks($announcement);
// add field-names and -values to array
$preset->add_marks($announcement);
//.........这里部分代码省略.........
示例8: mail
mail($eMailAdr, $subject, $text, $headers);
if ($debugEnable) {
$debug .= "Mail to: " . $eMailAdr . " Subj: " . $subject . " Headers: " . $headers . "<br /> \n";
}
$mainTextHTML .= "<p>Ett nytt lösenord har nu skickats till den \n angivna epostadressen.</p> \n";
$form->removeChild($buttons);
// Tag bort knapparna.
$form->toggleFrozen(true);
// Frys formuläret inför ny visning.
} else {
$mainTextHTML .= "<p>Den angivna epostadressen kunde inte hittas i \n databasen.</p> \n";
}
}
/*
* Om formuläret inte är riktigt ifyllt så skrivs det ut igen med kommentarer.
*/
$renderer = HTML_QuickForm2_Renderer::factory('default')->setOption(array('group_hiddens' => true, 'group_errors' => true, 'errors_prefix' => 'Följand information saknas eller är felaktigt ifylld:', 'errors_suffix' => '', 'required_note' => ''))->setTemplateForId('submit', '<div class="element">{element} or
<a href="/">Cancel</a></div>');
$form->render($renderer);
$mainTextHTML .= $renderer;
/*
* Define everything that shall be on the page, generate the left column
* and then display the page.
*/
$page = new CHTMLPage();
$pageTitle = "Nytt lösenord 1";
require TP_PAGES . 'rightColumn.php';
$page->printPage($pageTitle, $mainTextHTML, "", $rightColumnHTML);
?>
示例9: HTML_QuickForm2
.quickform div.errors ul { margin:0; }
.quickform div.error input { border-color: #C00; background-color: #FEF; }
.quickform div.qf-checkable label,
.quickform div.qf-checkable input { display: inline; float: none; }
.quickform div.qf-checkable div,
.quickform div.qf-message { margin-left: 170px; }
.quickform div.qf-message { font-size: 88%; color: #C00; }
</style>
<title>HTML_QuickForm2 default renderer example</title>
</head>
<body>
<?php
require_once 'HTML/QuickForm2.php';
require_once 'HTML/QuickForm2/Renderer.php';
$form = new HTML_QuickForm2('example');
$fs = $form->addFieldset()->setLabel('Your information');
$username = $fs->addText('username')->setLabel('Username');
$username->addRule('required', 'Username is required');
$password = $fs->addPassword('pass')->setLabel(array('Password', 'Password should be 8 characters at minimum'));
$password->addRule('required', 'Password is required');
$form->addHidden('my_hidden1')->setValue('1');
$form->addHidden('my_hidden2')->setValue('2');
$form->addSubmit('submit', array('value' => 'Send', 'id' => 'submit'));
if ($form->validate()) {
$form->toggleFrozen(true);
}
$renderer = HTML_QuickForm2_Renderer::factory('default')->setOption(array('group_hiddens' => true, 'group_errors' => true, 'required_note' => '<strong>Note:</strong> Required fields are marked with an asterisk (<em>*</em>).'))->setTemplateForId('submit', '<div class="element">{element} or <a href="/">Cancel</a></div>')->setTemplateForClass('HTML_QuickForm2_Element_Input', '<div class="element<qf:error> error</qf:error>"><qf:error>{error}</qf:error>' . '<label for="{id}" class="qf-label<qf:required> required</qf:required>">{label}</label>' . '{element}' . '<qf:label_2><div class="qf-label-1">{label_2}</div></qf:label_2></div>');
echo $form->render($renderer);
?>
</body>
</html>
示例10: campaign_add
//.........这里部分代码省略.........
$allowed_mimetype = 'image/gif,image/jpeg,image/pjpeg,image/png';
$form->addElement('static','','',array('content'=>'<b>Upload Header Image for your Campaign ? (image width will be resize to 400px)</b>'));
$r_file = $form->addElement('file','image_header_uploadfile','size="80"');
$r_file->addRule('mimetype', 'Image is not valid file type', explode(',',$allowed_mimetype),HTML_QuickForm2_Rule::SERVER);
$r_file->addRule('maxfilesize', 'Image filesize is exceeded ', $allowed_maxfilesize,HTML_QuickForm2_Rule::SERVER);
if($gid){
$form->addElement('static','','',array('content'=>'<img src="'.site_url('image/campaign')."?src=".$campaign['image_header'].'">'));
} */
$date_set = $gid ? array('format' => 'dFY His', 'maxYear' => date('Y')) : array('format' => 'dFY His', 'minYear' => date('Y'), 'maxYear' => date('Y') + 1);
$form->addElement('static', '', '', array('content' => '<b>When will your campaign will start ?</b>'));
$startdate_group = $form->addElement('group');
$startdate_group->addElement('date', 'startdate', '', $date_set, 'style="width:100px;"');
$startdate_group->addRule('callback', 'Start Date with this Facebook App Name/ID cannot be Overlap with other Campaigns', 'callback_validateStartDate');
$form->addElement('static', '', '', array('content' => '<b>When will Upload end ?</b>'));
$upload_enddate_group = $form->addElement('group');
$upload_enddate_group->addElement('date', 'upload_enddate', '', $date_set, 'style="width:100px;"');
$upload_enddate_group->addRule('callback', 'Date must be longer than start date', 'callback_validateUploadEndDate');
$form->addElement('static', '', '', array('content' => '<b>Judging and Announcement before campaign end ?</b>'));
$winner_selectiondate_group = $form->addElement('group');
$winner_selectiondate_group->addElement('date', 'winner_selectiondate', '', $date_set, 'style="width:100px;"');
$winner_selectiondate_group->addRule('callback', 'Date must be longer than Upload date and shorter or the same as end date', 'callback_validateWinnerDate');
$form->addElement('static', '', '', array('content' => '<b>When will your campaign end ?</b>'));
$enddate_group = $form->addElement('group');
$enddate_group->addElement('date', 'enddate', '', $date_set, 'style="width:100px;"');
$enddate_group->addRule('callback', 'Date must be longer than upload end date', 'callback_validateEndDate');
$form->addElement('static', '', '', array('content' => '<b>Set allowed media to be use for the contest ?</b>'));
$fsAddFields = $form->addElement('group');
$data_media_source = @$campaign['allowed_media_source'] ? explode(',', $campaign['allowed_media_source']) : array();
foreach (array('youtube' => 'Youtube Only (Video)', 'file' => 'File Upload (Image Only)') as $k => $v) {
$checked = count(array_intersect($data_media_source, explode(',', $k))) == count($data_media_source) ? 'checked = "checked"' : '';
$fsAddFields->addElement('radio', 'allowed_media_source', $checked . " value='" . $k . "' style='width:0px;'");
$fsAddFields->addElement('static', '', '', array('content' => $v . '<br/>'));
}
$allowed_media_fields = $form->addElement('hidden', 'allowed_media_fields', array('style' => ''))->setValue("media_source=Upload Content Here&media_description=It's About");
$allowed_mimetype = $form->addElement('hidden', 'allowed_mimetype', array('style' => ''))->setValue('image/gif,image/jpeg,image/pjpeg,image/png');
$form->addElement('static', '', '', array('content' => '<b>Does User can only upload once ?</b>'));
$media_has_uploadonce = $form->addElement('select', 'media_has_uploadonce', '', array('options' => array('1' => 'Yes', '0' => 'No')));
$form->addElement('static', '', '', array('content' => '<b>Does the uploaded media has vote system ?</b>'));
$media_has_approval = $form->addElement('select', 'media_has_vote', '', array('options' => array('1' => 'Yes', '0' => 'No')));
$form->addElement('static', '', '', array('content' => '<b>Does the uploaded media need approval by admin before published ?</b>'));
$media_has_approval = $form->addElement('select', 'media_has_approval', '', array('options' => array('1' => 'Yes', '0' => 'No')));
$form->addElement('static', '', '', array('content' => '<b>Does media use Facebook Comments (Social Plugin) ?</b>'));
$media_has_fbcomment = $form->addElement('select', 'media_has_fbcomment', '', array('options' => array('1' => 'Yes', '0' => 'No')));
$form->addElement('static', '', '', array('content' => '<b>Does media use Facebook Like (Social Plugin) ?</b>'));
$media_has_fblike = $form->addElement('select', 'media_has_fblike', '', array('options' => array('1' => 'Yes', '0' => 'No')));
$form->addElement('static', '', '', array('content' => '<b>Define your Campaign Rules/FAQ ?</b>'));
$campaign_rules = $form->addElement('textarea', 'campaign_rules', array('style' => 'height:400px', 'id' => 'campaign_rules'));
$stitle->addRule('required', 'Title is required', null, HTML_QuickForm2_Rule::SERVER);
$sdescription->addRule('required', 'Description is required', null, HTML_QuickForm2_Rule::SERVER);
$button = $form->addElement('submit', '', 'value="Submit Campaign"');
$html = array();
if ($form->validate()) {
$data = $form->getValue();
unset($data['submit'], $data['_qf__campaign']);
extract($data['startdate']);
$data['startdate'] = $Y . '-' . $F . '-' . $d . ' ' . $H . ':' . $i . ':' . $s;
extract($data['enddate']);
$data['enddate'] = $Y . '-' . $F . '-' . $d . ' ' . $H . ':' . $i . ':' . $s;
extract($data['upload_enddate']);
$data['upload_enddate'] = $Y . '-' . $F . '-' . $d . ' ' . $H . ':' . $i . ':' . $s;
extract($data['winner_selectiondate']);
$data['winner_selectiondate'] = $Y . '-' . $F . '-' . $d . ' ' . $H . ':' . $i . ':' . $s;
$data['allowed_media_fields'] = html_entity_decode($data['allowed_media_fields']);
$allowed_media_source = explode(',', $data['allowed_media_source']);
if ($media = array_intersect(array('plixi', 'twitpic', 'yfrog'), $allowed_media_source)) {
$data['allowed_media_source'] = implode(',', $media);
$data['allowed_media_type'] = 'image';
} elseif ($media = array_intersect(array('youtube', 'facebook'), $allowed_media_source)) {
$data['allowed_media_source'] = implode(',', $media);
$data['allowed_media_type'] = 'video';
} elseif ($media = array_intersect(array('file'), $allowed_media_source)) {
$data['allowed_media_source'] = implode(',', $media);
$data['allowed_media_type'] = 'image';
}
$ok = false;
if ($gid) {
if ($ok = $this->campaign_m->updateCampaign($data)) {
$this->notify->set_message('success', 'Data has been successfuly updated.');
} else {
$this->notify->set_message('error', 'Data has failed to be updated.');
}
} else {
unset($data['gid']);
if ($ok = $this->campaign_m->addCampaign($data)) {
$this->notify->set_message('success', 'Data has been successfuly submitted.');
} else {
$this->notify->set_message('error', 'Data has failed to be submitted.');
}
}
if ($ok) {
$form->removeChild($button);
$form->toggleFrozen(true);
}
}
$renderer = HTML_QuickForm2_Renderer::factory('default');
$form_layout = $form->render($renderer);
return $form_layout;
}
示例11: toObject
/** @return object with rendered input elements + ->hidden for hidden inputs */
public function toObject()
{
$arr = $this->render(HTML_QuickForm2_Renderer::factory('array'))->toArray();
$ret = new stdclass();
foreach ($arr['elements'] as $el) {
$ret->{preg_replace('/-\\d+$/', '', $el['id'])} = $el['html'];
}
$ret->_id = $arr['id'];
$ret->_hidden = implode("\n", $arr['hidden']);
$ret->_javascript = $arr['javascript'];
$ret->_attributes = $arr['attributes'];
return $ret;
}
示例12: edit
/**
* edit edits the given entry
*
* @param int $cid entry-id for calendar
* @return string html-string
*/
private function edit($cid)
{
// check rights
if (Rights::check_rights($cid, 'calendar')) {
// smarty-templates
$sD = new JudoIntranetSmarty();
// get calendar-object
$calendar = new Calendar($cid);
// pagecaption
$this->tpl->assign('pagecaption', parent::lang('class.CalendarView#page#caption#edit') . ": \"{$cid}\" (" . $calendar->get_name() . ")");
// get rights
$cRights = $calendar->get_rights()->get_rights();
// check public access
$kPublicAccess = array_search(0, $cRights);
$publicAccess = false;
if ($kPublicAccess !== false) {
$publicAccess = true;
unset($cRights[$kPublicAccess]);
}
// prepare return
$return = '';
$form = new HTML_QuickForm2('edit_calendar_entry', 'post', array('name' => 'edit_calendar_entry', 'action' => 'calendar.php?id=edit&cid=' . $cid));
$now_year = (int) date('Y');
$year_min = $now_year;
$year_max = $now_year + 3;
// get datasource
$datasource = array('date' => $calendar->get_date(), 'name' => $calendar->get_name(), 'shortname' => $calendar->get_shortname(), 'type' => $calendar->return_type(), 'entry_content' => $calendar->get_content(), 'rights' => $cRights);
// add public access
if ($publicAccess) {
$datasource['public'] = 1;
}
$form->addDataSource(new HTML_QuickForm2_DataSource_Array($datasource));
// renderer
$renderer = HTML_QuickForm2_Renderer::factory('default');
$renderer->setOption('required_note', parent::lang('class.CalendarView#entry#form#requiredNote'));
// elements
// date
$date = $form->addElement('text', 'date', array());
$date->setLabel(parent::lang('class.CalendarView#entry#form#date') . ':');
// rule
$date->addRule('required', parent::lang('class.CalendarView#entry#rule#required.date'));
$date->addRule('callback', parent::lang('class.CalendarView#entry#rule#check.date'), array($this, 'callback_check_date'));
// add jquery-datepicker
// smarty
$sD->assign('elementid', 'date-0');
$sD->assign('dateFormat', 'yy-mm-dd');
$sD->assign('dateValue', $calendar->get_date());
$this->add_jquery($sD->fetch('smarty.js-datepicker.tpl'));
// name
$name = $form->addElement('text', 'name');
$name->setLabel(parent::lang('class.CalendarView#entry#form#name') . ':');
$name->addRule('required', parent::lang('class.CalendarView#entry#rule#required.name'));
$name->addRule('regex', parent::lang('class.CalendarView#entry#rule#regexp.allowedChars') . ' [' . $_SESSION['GC']->get_config('name.desc') . ']', $_SESSION['GC']->get_config('name.regexp'));
// shortname
$shortname = $form->addElement('text', 'shortname');
$shortname->setLabel(parent::lang('class.CalendarView#entry#form#shortname') . ':');
$shortname->addRule('regex', parent::lang('class.CalendarView#entry#rule#regexp.allowedChars') . ' [' . $_SESSION['GC']->get_config('name.desc') . ']', $_SESSION['GC']->get_config('name.regexp'));
// type
$options = array_merge(array(0 => '--'), Calendar::return_types());
$type = $form->addElement('select', 'type');
$type->setLabel(parent::lang('class.CalendarView#entry#form#type') . ':');
$type->loadOptions($options);
$type->addRule('required', parent::lang('class.CalendarView#entry#rule#required.type'));
$type->addRule('callback', parent::lang('class.CalendarView#entry#rule#check.select'), array($this, 'callback_check_select'));
// entry_content
$content = $form->addElement('textarea', 'entry_content');
$content->setLabel(parent::lang('class.CalendarView#entry#form#entry_content') . ':');
$content->addRule('regex', parent::lang('class.CalendarView#entry#rule#regexp.allowedChars') . ' [' . $_SESSION['GC']->get_config('textarea.desc') . ']', $_SESSION['GC']->get_config('textarea.regexp'));
// select rights
$options = $_SESSION['user']->return_all_groups('sort');
$rights = $form->addElement('select', 'rights', array('multiple' => 'multiple', 'size' => 5));
$rights->setLabel(parent::lang('class.CalendarView#entry#form#rights') . ':');
$rights->loadOptions($options);
// checkbox public
$rights = $form->addElement('checkbox', 'public');
$rights->setLabel(parent::lang('class.CalendarView#entry#form#public') . ':');
// submit-button
$form->addElement('submit', 'submit', array('value' => parent::lang('class.CalendarView#entry#form#submitButton')));
// validate
if ($form->validate()) {
// create calendar-object
$data = $form->getValue();
// check $data['rights']
if (!isset($data['rights'])) {
$data['rights'] = array();
}
// merge with own groups, add admin
$data['rights'] = array_merge($data['rights'], $_SESSION['user']->get_groups(), array(1));
// add public access
$kPublicAccess = array_search(0, $data['rights']);
if ($kPublicAccess === false && isset($data['public']) && $data['public'] == 1) {
$data['rights'][] = 0;
} elseif ($kPublicAccess !== false && !isset($data['public'])) {
unset($data['rights'][$kPublicAccess]);
//.........这里部分代码省略.........
示例13: __toString
public function __toString()
{
require_once 'HTML/QuickForm2/Renderer.php';
return $this->render(HTML_QuickForm2_Renderer::factory('default'))->__toString();
}
示例14: renderEasyArray
/**
* @return array of elements for easy custom form building
*/
public function renderEasyArray()
{
$renderer = HTML_QuickForm2_Renderer::factory('array');
$renderer->setJavascriptBuilder(new Am_Form_JavascriptBuilder());
$renderer->getJavascriptBuilder()->addValidateJs('errorElement: "span"');
/* @var $renderer HTML_QuickForm2_Renderer_Array */
$this->render($renderer);
$arr = $renderer->toArray();
if (isset($arr['hidden'])) {
$arr['hidden'] = implode("\n", $arr['hidden']);
}
$this->_renderArrayGroups($arr);
return $arr;
}
示例15: createForm
function createForm($form)
{
HTML_QuickForm2_Renderer::register('smarty', 'HTML_QuickForm2_Renderer_Smarty');
$renderer = HTML_QuickForm2_Renderer::factory('smarty');
$renderer->setOption(array('required_note' => "<em>*</em> 記入必須項目"));
$renderer->setOption('old_compat', true);
$renderer->setOption('group_errors', true);
// フォームの作成
$FormData = $form->render($renderer)->toArray();
$this->smarty->assign('form', $FormData);
$this->smarty->display('address_setting.html');
}