本文整理汇总了PHP中FormBuilder::render方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::render方法的具体用法?PHP FormBuilder::render怎么用?PHP FormBuilder::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormBuilder
$formBuilder = new FormBuilder("message-write", "/restful/user/panels/messages/send.php");
$fields[] = array("id" => "to", "type" => "textinput", "label" => "A:", "validation" => "required,Specifica a chi inviare il messaggio");
$fields[] = array("id" => "subject", "type" => "textinput", "label" => "Oggetto:", "validation" => "required, Specifica l'oggetto");
// Aggiungi multiplo e importante solo se l'utente e' admin
if ($currentUser->isAdmin()) {
$fields[] = array("id" => "multiple", "type" => "checkbox", "label" => "Invia a tutti i membri:");
$fields[] = array("id" => "important", "type" => "checkbox", "label" => "Importante:", "value" => true);
}
$fields[] = array("id" => "message", "type" => "textarea", "validation" => "required,Devi scrivere un messaggio");
$formBuilder->addFields($fields);
$formBuilder->setCloseable(true);
$formBuilder->setDefaultSubmit("Invia");
$formBuilder->setVisible(false);
$formBuilder->addWidget(new BbButtonWidget($formBuilder->getDOMId("message"), "code|quote|g|c|s"));
$formBuilder->addWidget(new SmilesWidget($formBuilder->getDOMId("message")));
echo $formBuilder->render();
?>
</div>
<script language='javascript'>
"use strict";
var Messages = (function(){
var p = {
order : "date_desc",
folder : "",
folder_name : "",
important : false,
page : 1,
sending : false,
date_asc : false,
示例2: renderTemplate
$template = "\n <form name='newUser' class='form-horizontal' id='newUser' role='form' action='api/create_user.php' method='post'>\n\t\t <div class='row'>\n\t\t\t<div id='display-alerts' class='col-lg-12'>\n\t\t \n\t\t\t</div>\n\t\t </div>\t\t\n\t\t <div class='row'>\n\t\t\t<div class='col-sm-12'>\n {{user_name}}\n </div>\n\t\t </div>\n\t\t <div class='row'>\n <div class='col-sm-12'>\n {{display_name}}\n </div>\n\t\t </div>\n\t\t <div class='row'>\n\t\t\t<div class='col-sm-12'>\n {{email}}\n </div>\n\t\t </div>\t\t \n\t\t <div class='row'>\n <div class='col-sm-12'>\n {{password}}\n </div>\n\t\t </div>\n\t\t <div class='row'>\n <div class='col-sm-12'>\n {{passwordc}}\n </div>\n\t\t </div>\n\t\t <div class='row'>\n <div class='col-sm-12'>\n {{captcha}}\n </div>\n </div>\n <div class='form-group'>\n <div class='col-sm-12'>\n <img src='{$captcha}' id='captcha'>\n </div>\n\t\t </div>\n\t\t <br>\n\t\t <div class='form-group'>\n\t\t\t<div class='col-sm-12'>\n\t\t\t <button type='submit' class='btn btn-success submit' value='Register'>Register</button>\n\t\t\t</div>\n\t\t </div>\n <div class='collapse'>\n <label>Spiderbro: Don't change me bro, I'm tryin'a catch some flies!</label>\n <input name='spiderbro' id='spiderbro' value='http://'/>\n </div> \n\t\t</form>";
$fb = new FormBuilder($template, $fields, [], [], true);
?>
<body>
<div class="container">
<div class="header">
<ul class="nav nav-pills navbar pull-right">
</ul>
<h3 class="text-muted">UserFrosting</h3>
</div>
<div class="jumbotron">
<h1>Let's get started!</h1>
<p class="lead">Registration is fast and simple.</p>
<?php
echo $fb->render();
?>
</div>
<?php
echo renderTemplate("footer.html");
?>
</div> <!-- /container -->
<script>
$(document).ready(function() {
// Load navigation bar
$(".navbar").load("header-loggedout.php", function() {
$(".navbar .navitem-register").addClass('active');
});
示例3: FormBuilder
$disable_primary_toggle = "disabled";
}
$template .= "/>";
if ((!$populate_fields and $is_default == 2) || $populate_fields && $id == $user['primary_group_id']) {
$primary_group_checked = "true";
} else {
$primary_group_checked = "false";
}
$template .= " <button type='button' class='bootstrapradio' name='primary_group_id' value='{$id}' title='Set as primary group' data-selected='{$primary_group_checked}' {$disable_primary_toggle}><i class='fa fa-home'></i></button>";
$template .= "</span>\n </li>";
}
$template .= "\n </ul>\n </div>";
}
}
$template .= "</div>";
// Buttons
$template .= "<br>\n<div class='row'>\n <div class='col-xs-8 col-sm-4 hideable'>\n {{btn_submit}}\n </div>\n <div class='col-xs-6 col-sm-3 hideable'>\n {{btn_edit}}\n </div> \n <div class='col-xs-6 col-sm-3 hideable'>\n {{btn_activate}}\n </div>\n <div class='col-xs-6 col-sm-3 hideable'> \n {{btn_enable}}\n </div>\n <div class='col-xs-6 col-sm-3 hideable'> \n {{btn_disable}}\n </div>\n <div class='col-xs-6 col-sm-3 hideable'>\n {{btn_delete}}\n </div> \n <div class='col-xs-4 col-sm-3 pull-right'>\n {{btn_cancel}}\n </div>\n</div>";
// Add closing tags as appropriate
if ($get['render_mode'] == "modal") {
$template .= "</form></div></div></div></div>";
} else {
$template .= "</form></div></div>";
}
// Render form
$fb = new FormBuilder($template, $fields, $buttons, $user);
$response = $fb->render();
if ($ajax) {
echo json_encode(array("data" => $response), JSON_FORCE_OBJECT);
} else {
echo $response;
}