本文整理匯總了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;
}