1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Provides a table layout for sections in the Profiler library.
9 * @copyright (c) 2007-2008 Kohana Team
10 * @license http://kohanaphp.com/license.html
12 class Profiler_Table
{
14 protected $columns = array();
15 protected $rows = array();
18 * Get styles for table.
22 public function styles()
24 static $styles_output;
26 if ( ! $styles_output)
28 $styles_output = TRUE;
29 return file_get_contents(Kohana
::find_file('views', 'kohana_profiler_table', FALSE, 'css'));
36 * Add column to table.
38 * @param string CSS class
39 * @param string CSS style
41 public function add_column($class = '', $style = '')
43 $this->columns
[] = array('class' => $class, 'style' => $style);
49 * @param array data to go in table cells
50 * @param string CSS class
51 * @param string CSS style
53 public function add_row($data, $class = '', $style = '')
55 $this->rows
[] = array('data' => $data, 'class' => $class, 'style' => $style);
63 public function render()
65 $data['rows'] = $this->rows
;
66 $data['columns'] = $this->columns
;
67 return View
::factory('kohana_profiler_table', $data)->render();