本文整理汇总了PHP中FormBuilder::addValue方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::addValue方法的具体用法?PHP FormBuilder::addValue怎么用?PHP FormBuilder::addValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::addValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exequery
// TODO: cerca topic
// argument e' l'id del canale del forum (Android, C++, Off-Topic, etc.)
$limit = DB::GetLimit($_GET['p'], Forum::TOPICS_PER_PAGE);
$q = exequery(DB::SelectCalcFoundRows(Topic::SELECT_SQL) . "\n\t\t\t\tWHERE p.argument = {$_GET['id']} AND p.type = " . Forum::TYPE_TOPIC . " \n\t\t\t\tORDER BY p.show_as DESC, p.last_post_date DESC\n\t\t\t\tLIMIT {$limit}");
$topics_count = DB::GetCalcFoundRows();
// TODO: aggiungi indice su show_as
?>
<div class="center" style="margin-bottom: 1em;"> <!-- nuovo post -->
<?php
$formBuilder = new FormBuilder("frm-forum-post", "/restful/forum/newtopic.php");
$fields = array();
$fields[] = array("id" => "subject", "type" => "textinput", "label" => "Oggetto:", "validation" => "required,Specifica un oggetto per il messaggio");
$fields[] = array("id" => "poll", "type" => "textarea", "label" => "Sondaggio:<br/><span class='small'>(1 domanda per linea)</span>", "attrs" => "style='height: 6em;'");
$fields[] = array("id" => "message", "type" => "textarea", "validation" => "required,Devi scrivere un messaggio");
$formBuilder->addValue("forum_id", $_GET['id']);
$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> <!-- fine nuovo post -->
<script>
"use strict";
FormBuilder.On("frm-forum-post", "Closed", function(e){
$("#view-forum-container").show();
e.stopPropagation();
示例2: FormBuilder
echo $post->render("forum/post.html");
}
?>
</div> <!-- /forum-thread -->
<div style="text-align: right;">
<input type="button" value="Rispondi" id="btn-forum-reply" />
</div>
<div class="center">
<?php
$formBuilder = new FormBuilder("frm-forum-reply", "/restful/forum/reply.php");
$fields = array();
$fields[] = array("id" => "message", "type" => "textarea", "validation" => "required,Devi scrivere un messaggio");
$formBuilder->addValue("topic_id", $topic["id"]);
$formBuilder->addFields($fields);
$formBuilder->setCloseable(true);
$formBuilder->setDefaultSubmit("Rispondi");
$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>
"use strict";
$("#btn-forum-reply").click(function(e){
if (!$(this).hasClass("disabled")){
// Se l'utente e' loggato mostra il form per rispondere, altrimenti il pannello di login