本文整理汇总了PHP中Kohana::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Kohana::output方法的具体用法?PHP Kohana::output怎么用?PHP Kohana::output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kohana
的用法示例。
在下文中一共展示了Kohana::output方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
if (Kohana::config('core.render_stats') === TRUE) {
// Replace the global template variables
Kohana::$output = str_replace(array('{hanami_version}', '{hanami_codename}'), array(HANAMI_VERSION, HANAMI_CODENAME), Kohana::$output);
}
}
示例2: output_buffer
/**
* Kohana output handler.
*
* @param string current output buffer
* @return string
*/
public static function output_buffer($output)
{
if (!Event::has_run('system.send_headers')) {
// Run the send_headers event, specifically for cookies being set
Event::run('system.send_headers');
}
// Set final output
self::$output = $output;
// Set and return the final output
return $output;
}
示例3: output_buffer
/**
* Kohana output handler. Called during ob_clean, ob_flush, and their variants.
*
* @param string current output buffer
* @return string
*/
public static function output_buffer($output)
{
// Could be flushing, so send headers first
if (!Event::has_run('system.send_headers')) {
// Run the send_headers event
Event::run('system.send_headers');
}
self::$output = $output;
// Set and return the final output
return self::$output;
}
示例4: prevent_output
/**
* Prevent any output from being displayed. Executed during system.display.
*
* @return void
*/
public static function prevent_output()
{
Kohana::$output = '';
}
示例5: render
/**
* Render the profiler. Output is added to the bottom of the page by default.
*
* @param boolean return the output if TRUE
* @return void|string
*/
public function render($return = FALSE)
{
$start = microtime(TRUE);
$get = isset($_GET['profiler']) ? explode(',', $_GET['profiler']) : array();
$this->show = empty($get) ? Kohana::config('profiler.show') : $get;
Event::run('profiler.run', $this);
$styles = '';
foreach ($this->profiles as $profile) {
$styles .= $profile->styles();
}
// Don't display if there's no profiles
if (empty($this->profiles)) {
return;
}
// Load the profiler view
$data = array('profiles' => $this->profiles, 'styles' => $styles, 'execution_time' => microtime(TRUE) - $start);
$view = new View('kohana_profiler', $data);
// Return rendered view if $return is TRUE
if ($return == TRUE) {
return $view->render();
}
// Add profiler data to the output
if (stripos(Kohana::$output, '</body>') !== FALSE) {
// Closing body tag was found, insert the profiler data before it
Kohana::$output = str_ireplace('</body>', $view->render() . '</body>', Kohana::$output);
} else {
// Append the profiler data to the output
Kohana::$output .= $view->render();
}
}