当前位置: 首页>>代码示例>>PHP>>正文


PHP renderer_base::render_from_template方法代码示例

本文整理汇总了PHP中renderer_base::render_from_template方法的典型用法代码示例。如果您正苦于以下问题:PHP renderer_base::render_from_template方法的具体用法?PHP renderer_base::render_from_template怎么用?PHP renderer_base::render_from_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在renderer_base的用法示例。


在下文中一共展示了renderer_base::render_from_template方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: message_popup_render_navbar_output

/**
 * Renders the popup.
 *
 * @param renderer_base $renderer
 * @return string The HTML
 */
function message_popup_render_navbar_output(\renderer_base $renderer)
{
    global $USER, $DB, $CFG;
    // Early bail out conditions.
    if (!isloggedin() || isguestuser() || user_not_fully_set_up($USER) || get_user_preferences('auth_forcepasswordchange')) {
        return '';
    }
    $output = '';
    // Add the messages popover.
    if (!empty($CFG->messaging)) {
        $context = ['userid' => $USER->id, 'urls' => ['preferences' => (new moodle_url('/message/edit.php', ['id' => $USER->id]))->out()]];
        $output .= $renderer->render_from_template('message_popup/message_popover', $context);
    }
    // Add the notifications popover.
    $processor = $DB->get_record('message_processors', array('name' => 'popup'));
    if ($processor && $processor->enabled) {
        $context = ['userid' => $USER->id, 'urls' => ['preferences' => (new moodle_url('/message/notificationpreferences.php', ['userid' => $USER->id]))->out()]];
        $output .= $renderer->render_from_template('message_popup/notification_popover', $context);
    }
    return $output;
}
开发者ID:dg711,项目名称:moodle,代码行数:27,代码来源:lib.php

示例2: message_popup_render_navbar_output

/**
 * Renders the popup.
 *
 * @param renderer_base $renderer
 * @return string The HTML
 */
function message_popup_render_navbar_output(\renderer_base $renderer)
{
    global $USER, $CFG;
    // Early bail out conditions.
    if (!isloggedin() || isguestuser() || user_not_fully_set_up($USER) || get_user_preferences('auth_forcepasswordchange') || $CFG->sitepolicy && !$USER->policyagreed && !is_siteadmin()) {
        return '';
    }
    $output = '';
    // Add the messages popover.
    if (!empty($CFG->messaging)) {
        $context = ['userid' => $USER->id, 'urls' => ['seeall' => (new moodle_url('/message/index.php'))->out(), 'writeamessage' => (new moodle_url('/message/index.php', ['contactsfirst' => 1]))->out(), 'preferences' => (new moodle_url('/message/edit.php', ['id' => $USER->id]))->out()]];
        $output .= $renderer->render_from_template('message_popup/message_popover', $context);
    }
    // Add the notifications popover.
    $enabled = \core_message\api::is_processor_enabled("popup");
    if ($enabled) {
        $context = ['userid' => $USER->id, 'urls' => ['seeall' => (new moodle_url('/message/output/popup/notifications.php'))->out(), 'preferences' => (new moodle_url('/message/notificationpreferences.php', ['userid' => $USER->id]))->out()]];
        $output .= $renderer->render_from_template('message_popup/notification_popover', $context);
    }
    return $output;
}
开发者ID:Chocolate-lightning,项目名称:moodle,代码行数:27,代码来源:lib.php

示例3: render

 /**
  * Renders this element
  *
  * @param renderer_base $output typically, the renderer that's calling this function
  * @return string
  */
 public function render(\renderer_base $output)
 {
     return $output->render_from_template('core/inplace_editable', $this->export_for_template($output));
 }
开发者ID:evltuma,项目名称:moodle,代码行数:10,代码来源:inplace_editable.php


注:本文中的renderer_base::render_from_template方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。