本文整理匯總了PHP中FireCake::table方法的典型用法代碼示例。如果您正苦於以下問題:PHP FireCake::table方法的具體用法?PHP FireCake::table怎麽用?PHP FireCake::table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FireCake
的用法示例。
在下文中一共展示了FireCake::table方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: table
/**
* Generate a table with FireCake
*
* @param array $rows Rows to print
* @param array $headers Headers for table
* @param array $options Additional options and params
* @return void
*/
function table($rows, $headers, $options = array())
{
$title = $headers[0];
if (isset($options['title'])) {
$title = $options['title'];
}
array_unshift($rows, $headers);
FireCake::table($title, $rows);
}
示例2: table
/**
* Generate a table with FireCake
*
* @param array $rows Rows to print
* @param array $headers Headers for table
* @param array $options Additional options and params
* @return void
*/
public function table($rows, $headers, $options = array())
{
$title = $headers[0];
if (isset($options['title'])) {
$title = $options['title'];
}
foreach ($rows as $i => $row) {
$rows[$i] = array_values($row);
}
array_unshift($rows, $headers);
FireCake::table($title, $rows);
}
示例3: testTable
/**
* test table() generation
*
* @return void
*/
public function testTable()
{
$table[] = array('Col 1 Heading', 'Col 2 Heading');
$table[] = array('Row 1 Col 1', 'Row 1 Col 2');
$table[] = array('Row 2 Col 1', 'Row 2 Col 2');
$table[] = array('Row 3 Col 1', 'Row 3 Col 2');
FireCake::table('myTrace', $table);
$expected = '162|[{"Type":"TABLE","Label":"myTrace"},[["Col 1 Heading","Col 2 Heading"],["Row 1 Col 1","Row 1 Col 2"],["Row 2 Col 1","Row 2 Col 2"],["Row 3 Col 1","Row 3 Col 2"]]]|';
$this->assertEqual($this->firecake->sentHeaders['X-Wf-1-1-1-1'], $expected);
}