本文整理匯總了PHP中FormHelper::getRelationRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormHelper::getRelationRow方法的具體用法?PHP FormHelper::getRelationRow怎麽用?PHP FormHelper::getRelationRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FormHelper
的用法示例。
在下文中一共展示了FormHelper::getRelationRow方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array_merge
">
<!-- List of existing relations -->
<?php
if (is_object($this->item)) {
$fathers = $this->item->getFathers();
$mothers = $this->item->getMothers();
$parents = array_merge($fathers, $mothers);
if (count($parents)) {
$k = 4;
for ($i = 0, $n = count($parents); $i < $n; $i++) {
$parent =& $parents[$i];
$parent->orderNumber = $i + 1;
?>
<!-- Row for one existing relation -->
<?php
echo FormHelper::getRelationRow($parent, 'parents', $this->form);
?>
<!-- End: Row for one existing relation -->
<?php
$k = 7 - $k;
}
}
}
?>
<!-- End: List of existing relations -->
</tbody>
<!-- End: tabel body for relations -->
</table>
<!-- End: Relations -->
示例2:
$tabRelId = 're' . $j . '_';
?>
<tbody id="<?php
echo $tabRelId;
?>
">
<?php
// loop through the children and filter on the correct parent
$k = 4;
for ($i = 0, $n = count($children); $i < $n; $i++) {
if ($children[$i]->secondParent_id == $partners[$j]->id) {
$child =& $children[$i];
$child->orderNumber = $orderNumber++;
// Row for one existing relation
echo FormHelper::getRelationRow($child, 'children', $this->form);
//End: Row for one existing relation
$k = 7 - $k;
}
}
?>
</tbody><!-- End: List of children -->
</table><!-- End: tabel body for relations -->
<?php
}
// end counter > 0 (children for specific partner)
}
// end looping through partners
}
// end else-branch
}
示例3:
echo $tabRelId;
?>
">
<!-- List of existing relations -->
<?php
if (is_object($this->item)) {
$partners = $this->item->getPartners();
if (count($partners)) {
$k = 4;
for ($i = 0, $n = count($partners); $i < $n; $i++) {
$partner =& $partners[$i];
$partner->orderNumber = $i + 1;
?>
<!-- Row for one existing relation -->
<?php
echo FormHelper::getRelationRow($partner, 'partners', $this->form);
?>
<!-- End: Row for one existing relation -->
<?php
$k = 7 - $k;
}
}
}
?>
<!-- End: List of existing relations -->
</tbody>
<!-- End: tabel body for relations -->
</table>
<!-- End: Relations -->