當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FOFModel::getItemList方法代碼示例

本文整理匯總了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;
                }
開發者ID:shoffmann52,項目名稱:install-from-web-server,代碼行數:67,代碼來源:strapper.php

示例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;
 }
開發者ID:rdeutz,項目名稱:babioon-event,代碼行數:21,代碼來源:events.php


注:本文中的FOFModel::getItemList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。