本文整理汇总了PHP中FOFModel::getItemList方法的典型用法代码示例。如果您正苦于以下问题:PHP FOFModel::getItemList方法的具体用法?PHP FOFModel::getItemList怎么用?PHP FOFModel::getItemList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOFModel
的用法示例。
在下文中一共展示了FOFModel::getItemList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFormBrowse
//.........这里部分代码省略.........
$html .= "\t\t" . '</select>' . "\n";
$html .= "\t" . '</div>' . "\n";
}
$html .= "\t</div>\n\n";
$html .= "\t" . '<div class="clearfix"> </div>' . "\n\n";
}
}
// Start the table output
$html .= "\t\t" . '<table class="table table-striped" id="itemsList">' . PHP_EOL;
// Open the table header region if required
if ($show_header || $show_filters && FOFPlatform::getInstance()->checkVersion(JVERSION, '3.0', 'lt')) {
$html .= "\t\t\t<thead>" . PHP_EOL;
}
// Render the header row, if enabled
if ($show_header) {
$html .= "\t\t\t\t<tr>" . PHP_EOL;
$html .= $header_html;
$html .= "\t\t\t\t</tr>" . PHP_EOL;
}
// Render filter row if enabled
if ($show_filters && FOFPlatform::getInstance()->checkVersion(JVERSION, '3.0', 'lt')) {
$html .= "\t\t\t\t<tr>";
$html .= $filter_html;
$html .= "\t\t\t\t</tr>";
}
// Close the table header region if required
if ($show_header || $show_filters && FOFPlatform::getInstance()->checkVersion(JVERSION, '3.0', 'lt')) {
$html .= "\t\t\t</thead>" . PHP_EOL;
}
// Loop through rows and fields, or show placeholder for no rows
$html .= "\t\t\t<tbody>" . PHP_EOL;
$fields = $form->getFieldset('items');
$num_columns = count($fields);
$items = $model->getItemList();
if ($count = count($items)) {
$m = 1;
foreach ($items as $i => $item) {
$table_item = $model->getTable();
$table_item->reset();
$table_item->bind($item);
$form->bind($item);
$m = 1 - $m;
$class = 'row' . $m;
$html .= "\t\t\t\t<tr class=\"{$class}\">" . PHP_EOL;
$fields = $form->getFieldset('items');
// Reorder the fields to have ordering first
if (FOFPlatform::getInstance()->checkVersion(JVERSION, '3.0', 'gt')) {
$tmpFields = array();
$j = 1;
foreach ($fields as $tmpField) {
if ($tmpField instanceof FOFFormFieldOrdering) {
$tmpFields[0] = $tmpField;
} else {
$tmpFields[$j] = $tmpField;
}
$j++;
}
$fields = $tmpFields;
ksort($fields, SORT_NUMERIC);
}
foreach ($fields as $field) {
$field->rowid = $i;
$field->item = $table_item;
$class = $field->labelClass ? 'class ="' . $field->labelClass . '"' : '';
$html .= "\t\t\t\t\t<td {$class}>" . $field->getRepeatable() . '</td>' . PHP_EOL;
}
示例2:
/**
* Method to get a list of items.
*
* @param boolean $overrideLimits Should I override set limits?
* @param string $group The group by clause
*
* @return array
*/
public function &getItemList($overrideLimits = false, $group = '')
{
$this->setState('limitstart', $this->input->get('limitstart', 0, 'UINT'));
$items = parent::getItemList($overrideLimits, $group);
if (FOFPlatform::getInstance()->isFrontend()) {
$Itemid = BabioonEventRouteHelper::getItemid();
$link = 'index.php?option=com_babioonevent&view=event&layout=item&Itemid=' . $Itemid . '&id=';
for ($i = 0, $ccount = count($items); $i < $ccount; $i++) {
$items[$i]->link = $link . $items[$i]->babioonevent_event_id;
}
}
return $items;
}