当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::addParameter方法代码示例

本文整理汇总了PHP中Paginator::addParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::addParameter方法的具体用法?PHP Paginator::addParameter怎么用?PHP Paginator::addParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::addParameter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     // get team info
     $teamId = NationalteamsDataService::getNationalTeamManagedByCurrentUser($this->_websoccer, $this->_db);
     if (!$teamId) {
         throw new Exception($this->_i18n->getMessage("nationalteams_user_requires_team"));
     }
     $result = $this->_db->querySelect("name", $this->_websoccer->getConfig("db_prefix") . "_verein", "id = %d", $teamId);
     $team = $result->fetch_array();
     $result->free();
     // query players
     $firstName = $this->_websoccer->getRequestParameter("fname");
     $lastName = $this->_websoccer->getRequestParameter("lname");
     $position = $this->_websoccer->getRequestParameter("position");
     $mainPosition = $this->_websoccer->getRequestParameter("position_main");
     $playersCount = NationalteamsDataService::findPlayersCount($this->_websoccer, $this->_db, $team["name"], $teamId, $firstName, $lastName, $position, $mainPosition);
     // setup paginator
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($playersCount, $eps, $this->_websoccer);
     $paginator->addParameter("fname", $firstName);
     $paginator->addParameter("lname", $lastName);
     $paginator->addParameter("position", $position);
     $paginator->addParameter("position_main", $mainPosition);
     $paginator->addParameter("search", "true");
     // get players records
     if ($playersCount > 0) {
         $players = NationalteamsDataService::findPlayers($this->_websoccer, $this->_db, $team["name"], $teamId, $firstName, $lastName, $position, $mainPosition, $paginator->getFirstIndex(), $eps);
     } else {
         $players = array();
     }
     return array("team_name" => $team["name"], "playersCount" => $playersCount, "players" => $players, "paginator" => $paginator);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:36,代码来源:FindNationalPlayersModel.class.php

示例2: getTemplateParameters

 public function getTemplateParameters()
 {
     $positionFilter = $this->_websoccer->getRequestParameter("position");
     $count = YouthPlayersDataService::countTransferableYouthPlayers($this->_websoccer, $this->_db, $positionFilter);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($positionFilter != null) {
         $paginator->addParameter("position", $positionFilter);
     }
     $players = YouthPlayersDataService::getTransferableYouthPlayers($this->_websoccer, $this->_db, $positionFilter, $paginator->getFirstIndex(), $eps);
     return array("players" => $players, "paginator" => $paginator);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:12,代码来源:YouthMarketplaceModel.class.php

示例3: getTemplateParameters

 public function getTemplateParameters()
 {
     $count = MessagesDataService::countOutboxMessages($this->_websoccer, $this->_db);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     $paginator->addParameter("block", "messages-outbox");
     if ($count > 0) {
         $messages = MessagesDataService::getOutboxMessages($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps);
     } else {
         $messages = array();
     }
     return array("messages" => $messages, "paginator" => $paginator);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:13,代码来源:MessagesOutboxModel.class.php

示例4: getTemplateParameters

 public function getTemplateParameters()
 {
     $clubId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     $userId = $this->_websoccer->getUser()->id;
     $offers = array();
     $count = DirectTransfersDataService::countSentOffers($this->_websoccer, $this->_db, $clubId, $userId);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     $paginator->addParameter("block", "directtransfer-sentoffers");
     if ($count > 0) {
         $offers = DirectTransfersDataService::getSentOffers($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps, $clubId, $userId);
     } else {
         $offers = array();
     }
     return array("offers" => $offers, "paginator" => $paginator);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:16,代码来源:TransferOffersSentModel.class.php

示例5: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     // get team info
     $teamId = NationalteamsDataService::getNationalTeamManagedByCurrentUser($this->_websoccer, $this->_db);
     if (!$teamId) {
         throw new Exception($this->_i18n->getMessage("nationalteams_user_requires_team"));
     }
     $matchesCount = NationalteamsDataService::countNextMatches($this->_websoccer, $this->_db, $teamId);
     // setup paginator
     $eps = 5;
     $paginator = new Paginator($matchesCount, $eps, $this->_websoccer);
     $paginator->addParameter("block", "national-next-matches");
     $matches = array();
     if ($matchesCount) {
         $matches = NationalteamsDataService::getNextMatches($this->_websoccer, $this->_db, $teamId, $paginator->getFirstIndex(), $eps);
     }
     return array("paginator" => $paginator, "matches" => $matches);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:22,代码来源:NationalNextMatchesModel.class.php

示例6: getTemplateParameters

 public function getTemplateParameters()
 {
     $playersCount = PlayersDataService::findPlayersCount($this->_websoccer, $this->_db, $this->_firstName, $this->_lastName, $this->_club, $this->_position, $this->_strength, $this->_lendableOnly);
     // setup paginator
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($playersCount, $eps, $this->_websoccer);
     $paginator->addParameter("block", "playerssearch-results");
     $paginator->addParameter("fname", $this->_firstName);
     $paginator->addParameter("lname", $this->_lastName);
     $paginator->addParameter("club", $this->_club);
     $paginator->addParameter("position", $this->_position);
     $paginator->addParameter("strength", $this->_strength);
     $paginator->addParameter("lendable", $this->_lendableOnly);
     // get players records
     if ($playersCount > 0) {
         $players = PlayersDataService::findPlayers($this->_websoccer, $this->_db, $this->_firstName, $this->_lastName, $this->_club, $this->_position, $this->_strength, $this->_lendableOnly, $paginator->getFirstIndex(), $eps);
     } else {
         $players = array();
     }
     return array("playersCount" => $playersCount, "players" => $players, "paginator" => $paginator);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:21,代码来源:PlayersSearchModel.class.php

示例7: getTemplateParameters

 public function getTemplateParameters()
 {
     $teamId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     if ($teamId < 1) {
         throw new Exception($this->_i18n->getMessage("feature_requires_team"));
     }
     $positionInput = $this->_websoccer->getRequestParameter("position");
     $positionFilter = null;
     if ($positionInput == "goaly") {
         $positionFilter = "Torwart";
     } else {
         if ($positionInput == "defense") {
             $positionFilter = "Abwehr";
         } else {
             if ($positionInput == "midfield") {
                 $positionFilter = "Mittelfeld";
             } else {
                 if ($positionInput == "striker") {
                     $positionFilter = "Sturm";
                 }
             }
         }
     }
     $count = PlayersDataService::countPlayersOnTransferList($this->_websoccer, $this->_db, $positionFilter);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($positionFilter != null) {
         $paginator->addParameter("position", $positionInput);
     }
     if ($count > 0) {
         $players = PlayersDataService::getPlayersOnTransferList($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps, $positionFilter);
     } else {
         $players = array();
     }
     return array("transferplayers" => $players, "playerscount" => $count, "paginator" => $paginator);
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:36,代码来源:TransfermarketOverviewModel.class.php


注:本文中的Paginator::addParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。