本文整理汇总了PHP中CommentForm::get_data方法的典型用法代码示例。如果您正苦于以下问题:PHP CommentForm::get_data方法的具体用法?PHP CommentForm::get_data怎么用?PHP CommentForm::get_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommentForm
的用法示例。
在下文中一共展示了CommentForm::get_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CommentForm
$view_form = 1;
// action actions on create
if ($action == "create") {
echo $OUTPUT->heading(get_string('createcomment', 'mod_emarking'));
//Creating form
$newcommentform = new CommentForm();
//Form Display
$newcommentform->display();
}
if ($action == "created") {
//Recration of the form
$newcommentform = new CommentForm();
//Form result
if ($newcommentform->is_cancelled()) {
$action = "list";
} elseif ($fromform = $newcommentform->get_data()) {
$record = new stdClass();
//Giving var record the necesary parameters
$record->text = $fromform->comment["text"];
$record->emarkingid = $emarking->id;
$record->markerid = $USER->id;
//Creating record in moodle DB
$DB->insert_record('emarking_predefined_comment', $record);
$action = "list";
}
}
// action action on delete
if ($action == "delete") {
//geting record to delete
$DB->delete_records('emarking_predefined_comment', array('id' => $deleteid));
$action = "list";