本文整理匯總了PHP中moodleform::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP moodleform::render方法的具體用法?PHP moodleform::render怎麽用?PHP moodleform::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類moodleform
的用法示例。
在下文中一共展示了moodleform::render方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render_course_enrolment_users_table
public function render_course_enrolment_users_table(course_enrolment_users_table $table, moodleform $mform)
{
$table->initialise_javascript();
// Added for the Bootstrap theme. Make this table responsive.
$table->attributes['class'] .= ' table table-responsive';
$buttons = $table->get_manual_enrol_buttons();
$buttonhtml = '';
if (count($buttons) > 0) {
$buttonhtml .= html_writer::start_tag('div', array('class' => 'enrol_user_buttons'));
foreach ($buttons as $button) {
$buttonhtml .= $this->render($button);
}
$buttonhtml .= html_writer::end_tag('div');
}
$content = '';
if (!empty($buttonhtml)) {
$content .= $buttonhtml;
}
$content .= $mform->render();
$content .= $this->output->render($table->get_paging_bar());
// Check if the table has any bulk operations. If it does we want to wrap the table in a
// form so that we can capture and perform any required bulk operations.
if ($table->has_bulk_user_enrolment_operations()) {
$content .= html_writer::start_tag('form', array('action' => new moodle_url('/enrol/bulkchange.php'), 'method' => 'post'));
foreach ($table->get_combined_url_params() as $key => $value) {
if ($key == 'action') {
continue;
}
$content .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $key, 'value' => $value));
}
$content .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'action', 'value' => 'bulkchange'));
$content .= html_writer::table($table);
$content .= html_writer::start_tag('div', array('class' => 'singleselect bulkuserop'));
$content .= html_writer::start_tag('select', array('name' => 'bulkuserop'));
$content .= html_writer::tag('option', get_string('withselectedusers', 'enrol'), array('value' => ''));
$options = array('' => get_string('withselectedusers', 'enrol'));
foreach ($table->get_bulk_user_enrolment_operations() as $operation) {
$content .= html_writer::tag('option', $operation->get_title(), array('value' => $operation->get_identifier()));
}
$content .= html_writer::end_tag('select');
$content .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('go')));
$content .= html_writer::end_tag('div');
$content .= html_writer::end_tag('form');
} else {
// Added for the Bootstrap theme, a no-overflow wrapper.
$content .= html_writer::start_tag('div', array('class' => 'no-overflow'));
$content .= html_writer::table($table);
$content .= html_writer::end_tag('div');
}
$content .= $this->output->render($table->get_paging_bar());
if (!empty($buttonhtml)) {
$content .= $buttonhtml;
}
return $content;
}
示例2: get_coupon_form_page
/**
* Get form page output (includes header/footer).
*
* @param \moodleform $mform
*/
protected function get_coupon_form_page($mform)
{
$out = '';
$out .= $this->header();
$out .= html_writer::start_div('block-coupon-container');
$out .= html_writer::start_div();
$out .= $this->get_tabs($this->page->context, 'wzcoupons', array('id' => $this->page->url->param('id')));
$out .= html_writer::end_div();
$out .= $mform->render();
$out .= html_writer::end_div();
$out .= $this->footer();
return $out;
}
示例3: render
public function render()
{
// Override render so we can output js to page.
global $PAGE;
if (isset($this->type)) {
$PAGE->requires->yui_module('moodle-mod_oublog-statsupdate', 'M.mod_oublog.statsupdate.init', array($this->type));
}
return parent::render();
}