本文整理汇总了PHP中FileMaker::getLayout方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::getLayout方法的具体用法?PHP FileMaker::getLayout怎么用?PHP FileMaker::getLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::getLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetLayout
/**
* @covers \airmoi\FileMaker\FileMaker::getLayout
*/
public function testGetLayout()
{
$layout = $this->fm->getLayout('sample');
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Object\Layout::class, $layout);
}
$this->assertEquals('sample', $layout->getName(), 'Layout name missmatch (' . $layout->getName() . ')');
}
示例2: fmDisplayFieldTR
<?php
/* This file connects to the CAROUSEL_online database and contains functions for displaying field information */
// Include FileMaker API
require_once "FileMaker.php";
//Create a new connection to CAROUSEL_online database.
//new FileMaker('DatabaseName', NULL [hostspec], 'username', 'password');
$fm = new FileMaker('CAROUSEL_online');
$fmLayout = $fm->getLayout('AllInfo');
//Display Record Information for Slideview
function fmDisplayFieldTR($fieldDisplayName, $fieldToDisplay, $record)
{
echo "<tr><td class='greytext'>{$fieldDisplayName}</td><td>";
echo fmDisplayFieldResult($fieldToDisplay, $record);
echo "</td></tr>";
}
//Displays field information from record
function fmDisplayFieldResult($fieldToDisplay, $record)
{
$fieldResult1 = htmlentities($record->getField($fieldToDisplay));
//replaces ampersands to HTML-friendly version
$fieldResult2 = str_replace("&", "&", $fieldResult1);
if (empty($fieldResult2)) {
//if field has nothing, returns greyed-out dash
return '<span class="greytext">-</span>';
} else {
return $fieldResult2;
}
}