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


PHP Link::setParam方法代码示例

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


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

示例1: set

 function set($arr, $page)
 {
     global $WikiName;
     list($name) = $this->splice($arr);
     // Ignore pages listed, or Expire ones not found
     if (in_array($name, $this->forceignorepages) || !is_page($name)) {
         return FALSE;
     }
     return parent::setParam($page, $name, '', 'pagename', $name);
 }
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:10,代码来源:make_link.php

示例2: set

 function set($arr, $page)
 {
     list($name) = $this->splice($arr);
     // Ignore words listed
     if (in_array($name, $this->forceignorepages)) {
         return FALSE;
     }
     return parent::setParam($page, $name, '', 'pagename', $name);
 }
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:9,代码来源:make_link.php

示例3: testSetParam

 /**
  * @covers Link::setParam
  */
 public function testSetParam()
 {
     $link = $this->link->setParam("id", 174);
     $this->assertInstanceOf("Link", $link);
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:8,代码来源:LinkTest.php

示例4: showRecordsPerPage

 private function showRecordsPerPage()
 {
     $numbers = array(Config::getInstance()->getInt("tablePaging/rowsPerPage", 10), 50, 100, 200);
     if ($this->getPaging()->getTotalRows() < $numbers[0]) {
         return;
     }
     $body = "Show:";
     foreach ($numbers as $number) {
         if ($number == $this->getPaging()->getRecordsPerPage()) {
             $recordsNumber = new HTMLElement("span");
             $recordsNumber->setBody($number);
         } else {
             $recordsNumber = new Link(Href::current());
             $recordsNumber->setParam(PagingInfoPrefs::getPageNumberParamName($this->getName()), floor($this->getPaging()->getFirstRecord() / $number));
             $recordsNumber->setTitle($number)->setParam(PagingInfoPrefs::getRecordsPerPageParamName($this->getName()), $number);
         }
         $body .= $recordsNumber;
         if ($this->getPaging()->getTotalRows() < $number) {
             break;
         }
     }
     $recordsPerPageSpan = new HTMLElement("span");
     $recordsPerPageSpan->set("class", "recordsPerPage");
     $recordsPerPageSpan->setBody($body);
     echo $recordsPerPageSpan;
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:26,代码来源:TableCSS3.php

示例5: writePageLinks

 /**
  * Write the links to the various pages, including the 'prev' and 'next'
  * links.
  */
 protected function writePageLinks()
 {
     $linksCount = Config::getInstance()->getInt("tablePaging/maxLinksCount", 10);
     $pageNumParamName = PagingInfoPrefs::getPageNumberParamName($this->getName());
     $recordsPerPageParamName = PagingInfoPrefs::getRecordsPerPageParamName($this->getName());
     $pageLink = new Link(Href::current());
     $pageLink->set("class", "pageNumber");
     $arrowLink = new Link(Href::current());
     $arrowLink->set("class", "arrows");
     $totalPages = $this->pagingInfo->getTotalPages();
     $lastLinkablePage = min($totalPages, $this->pagingInfo->getPageNumber() + $linksCount);
     $lastLinkIsShown = $lastLinkablePage == $totalPages;
     $i = max($this->pagingInfo->getPageNumber() - $linksCount, 0);
     $firstLinkIsShown = $i == 0;
     if (!$firstLinkIsShown) {
         echo $arrowLink->setTitle("First")->setParam($pageNumParamName, 0);
         echo "&nbsp;|&nbsp;";
     }
     if ($this->pagingInfo->getPageNumber() > 0) {
         echo $arrowLink->setTitle("Previous")->setParam($pageNumParamName, $this->pagingInfo->getPageNumber() - 1);
         echo " ";
     }
     if (!$firstLinkIsShown) {
         echo "...&nbsp;";
     }
     // If there's only one page available, don't write anything
     if ($i == $lastLinkablePage - 1) {
         echo "&nbsp;";
         return;
     }
     while ($i < $lastLinkablePage) {
         if ($i == $this->pagingInfo->getPageNumber()) {
             // Write current page number (not a link)
             $currentPageSpan = new HTMLElement("span");
             $currentPageSpan->set("class", "currentPage");
             $currentPageSpan->setBody($i + 1);
             echo $currentPageSpan;
         } else {
             // Write a link to this page
             $pageLink->setParam($pageNumParamName, $i);
             $pageLink->setTitle($i + 1);
             echo $pageLink;
         }
         echo "&nbsp;";
         $i++;
     }
     if (!$lastLinkIsShown) {
         echo "...";
     }
     //echo ($this->pagingInfo->getFirstRecord()+1) . " - " . ($this->pagingInfo->getFirstRecord() + $this->rowCount) . " of " . $this->pagingInfo->getTotalRows();
     if (!$this->pagingInfo->isLastPage()) {
         echo " ";
         echo $arrowLink->setTitle("Next")->setParam($pageNumParamName, $this->pagingInfo->getPageNumber() + 1);
     }
     if (!$lastLinkIsShown) {
         echo "&nbsp;|&nbsp;";
         echo $arrowLink->setTitle("Last")->setParam($pageNumParamName, $totalPages - 1);
     }
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:63,代码来源:Table.php

示例6: set

	function set($arr,$page)
	{
		global $WikiName;
		
		list($name) = $this->splice($arr);
		// 無視リストに含まれている、あるいは存在しないページを捨てる
		if (in_array($name,$this->forceignorepages) or !is_page($name))
		{
			return FALSE;
		}
		return parent::setParam($page,$name,'pagename',$name);
	}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:12,代码来源:make_link.php


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