本文整理汇总了PHP中core_renderer::box方法的典型用法代码示例。如果您正苦于以下问题:PHP core_renderer::box方法的具体用法?PHP core_renderer::box怎么用?PHP core_renderer::box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_renderer
的用法示例。
在下文中一共展示了core_renderer::box方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: box
public function box($contents, $classes = 'generalbox', $id = null, $attributes = array()) {
if (isset($attributes['data-rel']) && $attributes['data-rel'] === 'fatalerror') {
return html_writer::div($contents, 'alert alert-danger', $attributes);
}
return parent::box($contents, $classes, $id, $attributes);
}
示例2: formatted_contents
/**
* Make the formatted HTML ouput.
*
* Also adds the required javascript call to the page output.
*
* @param core_renderer $output
* @return string HTML
*/
protected function formatted_contents($output)
{
// based of code in admin_tree
global $PAGE;
// TODO change this when there is a proper way for blocks to get stuff into head.
static $eventattached;
if ($eventattached === null) {
$eventattached = true;
}
if (!$this->content) {
$this->content = new stdClass();
$this->content->items = array();
}
$this->get_required_javascript();
$this->get_content();
$content = $output->tree_block_contents($this->content->items, array('class' => 'block_tree list'));
if (isset($this->id) && !is_numeric($this->id)) {
$content = $output->box($content, 'block_tree_box', $this->id);
}
return $content;
}