本文整理汇总了PHP中FileMaker::listLayouts方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::listLayouts方法的具体用法?PHP FileMaker::listLayouts怎么用?PHP FileMaker::listLayouts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::listLayouts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FileMaker
* Requirements:
* 1. Working FileMaker Server installation
* 2. 'FMPHP_Sample' database hosted in FileMaker Server
*
*/
// Include FileMaker API
require_once 'FileMaker.php';
// Create a new connection to FMPHP_Sample database.
// Location of FileMaker Server is assumed to be on the same machine,
// thus we assume hostspec is api default of 'http://localhost' as specified
// in filemaker-api.php.
// If FMSA web server is on another machine, specify 'hostspec' as follows:
// $fm = new FileMaker('FMPHP_Sample', 'http://10.0.0.1');
$fm = new FileMaker('FMPHP_Sample');
// Call listLayouts() to get array of layout names.
$layouts = $fm->listLayouts();
// If an error is found, return a message and exit.
if (FileMaker::isError($layouts)) {
printf("Error %s: %s\n", $layouts->getCode());
"<br>";
printf($layouts->getMessage());
exit;
}
// Print out layout names
foreach ($layouts as $layout) {
echo $layout . "<br>";
}
?>
</body>
</html>
示例2: testListLayouts
/**
* @covers \airmoi\FileMaker\FileMaker::listLayouts
*/
public function testListLayouts()
{
$layouts = $this->fm->listLayouts();
$this->assertTrue(in_array('sample', $layouts));
}