本文整理匯總了PHP中Khill\Lavacharts\Utils::isDataTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils::isDataTable方法的具體用法?PHP Utils::isDataTable怎麽用?PHP Utils::isDataTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Khill\Lavacharts\Utils
的用法示例。
在下文中一共展示了Utils::isDataTable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAliasedIsDataTable
public function testAliasedIsDataTable()
{
$this->assertTrue(Utils::isDataTable(new c\DataTable()));
$this->assertFalse(Utils::isDataTable(new \stdClass()));
}
示例2: getChartJs
/**
* Checks the Chart for DataTable and builds the Javascript code block
*
* Build the script block for the actual chart and passes it back to
* output function of the calling chart object. If there are any
* events defined, they will be automatically be attached to the chart and
* pulled from the callbacks folder.
*
* @access public
*
* @uses Chart
* @param Chart $chart Chart object to render.
* @param string $elementId HTML element id to output the chart into.
* @throws DataTableNotFound
* @throws InvalidElementId
*
* @return string Javascript code block.
*/
public function getChartJs(Chart $chart, $elementId = null)
{
if (isset($chart->datatable) && Utils::isDataTable($chart->datatable)) {
$this->chart = $chart;
} else {
throw new DataTableNotFound($chart);
}
if (Utils::nonEmptyString($elementId)) {
$this->elementId = $elementId;
} else {
throw new InvalidElementId($elementId);
}
return $this->buildChartJs();
}