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


PHP tools::htmlentitiesUTF8方法代码示例

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


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

示例1: pagination

 public function pagination($nbProducts = 10)
 {
     if (!self::$initialized) {
         $this->init();
     }
     $nArray = Configuration::get('PS_PRODUCTS_PER_PAGE') != 10 ? array((int) Configuration::get('PS_PRODUCTS_PER_PAGE'), 10, 20, 50) : array(10, 20, 50);
     // Clean duplicate values
     $nArray = array_unique($nArray);
     asort($nArray);
     $this->n = abs((int) Tools::getValue('n', isset(self::$cookie->nb_item_per_page) && self::$cookie->nb_item_per_page >= 10 ? self::$cookie->nb_item_per_page : (int) Configuration::get('PS_PRODUCTS_PER_PAGE')));
     $this->p = abs((int) Tools::getValue('p', 1));
     if (!is_numeric(Tools::getValue('p', 1)) || Tools::getValue('p', 1) < 0) {
         Tools::redirect('404.php');
     }
     $current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
     //delete parameter page
     $current_url = preg_replace('/(\\?)?(&amp;)?p=\\d+/', '$1', $current_url);
     $range = 5;
     /* how many pages around page selected原值2改为更大值,但仍存在诸多问题 */
     if ($this->p < 0) {
         $this->p = 0;
     }
     if (isset(self::$cookie->nb_item_per_page) && $this->n != self::$cookie->nb_item_per_page && in_array($this->n, $nArray)) {
         self::$cookie->nb_item_per_page = $this->n;
     }
     if ($this->p > $nbProducts / $this->n + 1) {
         Tools::redirect(preg_replace('/[&?]p=\\d+/', '', $_SERVER['REQUEST_URI']));
     }
     $pages_nb = ceil($nbProducts / (int) $this->n);
     $start = (int) ($this->p - $range);
     if ($start < 1) {
         $start = 1;
     }
     $stop = (int) ($this->p + $range);
     if ($stop > $pages_nb) {
         $stop = (int) $pages_nb;
     }
     self::$smarty->assign('nb_products', $nbProducts);
     $pagination_infos = array('products_per_page' => (int) Configuration::get('PS_PRODUCTS_PER_PAGE'), 'pages_nb' => $pages_nb, 'p' => $this->p, 'n' => $this->n, 'nArray' => $nArray, 'range' => $range, 'start' => $start, 'stop' => $stop, 'current_url' => $current_url);
     self::$smarty->assign($pagination_infos);
 }
开发者ID:bubujie,项目名称:xixia,代码行数:41,代码来源:FrontController.php

示例2: assignPagination

 public function assignPagination($limit, $nbPosts)
 {
     $this->n = $limit;
     $this->p = abs((int) Tools::getValue('p', 1));
     $current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
     //delete parameter page
     $current_url = preg_replace('/(\\?)?(&amp;)?p=\\d+/', '$1', $current_url);
     $range = 2;
     /* how many pages around page selected */
     if ($this->p < 1) {
         $this->p = 1;
     }
     $pages_nb = ceil($nbPosts / (int) $this->n);
     $start = (int) ($this->p - $range);
     if ($start < 1) {
         $start = 1;
     }
     $stop = (int) ($this->p + $range);
     if ($stop > $pages_nb) {
         $stop = (int) $pages_nb;
     }
     $this->context->smarty->assign('nb_posts', $nbPosts);
     $pagination_infos = array('products_per_page' => $limit, 'pages_nb' => $pages_nb, 'p' => $this->p, 'n' => $this->n, 'range' => $range, 'start' => $start, 'stop' => $stop, 'current_url' => $current_url);
     $this->context->smarty->assign($pagination_infos);
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:25,代码来源:list.php

示例3: pagination

 public function pagination($nbProducts = 10)
 {
     if (!self::$initialized) {
         $this->init();
     }
     $nArray = (int) Configuration::get('TAS_ITEMS_PER_PAGE') != 20 ? array((int) Configuration::get('TAS_ITEMS_PER_PAGE'), 20) : array(20);
     // Clean duplicate values
     $nArray = array_unique($nArray);
     asort($nArray);
     $this->n = abs((int) Tools::getValue('n', (isset(self::$cookie->nb_item_per_page) and self::$cookie->nb_item_per_page >= 20) ? self::$cookie->nb_item_per_page : (int) Configuration::get('TAS_ITEMS_PER_PAGE')));
     $this->p = abs((int) Tools::getValue('p', 1));
     $current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
     //delete parameter page
     $current_url = preg_replace('/(\\?)?(&amp;)?p=\\d+/', '$1', $current_url);
     $range = 2;
     /* how many pages around page selected */
     if ($this->p < 0) {
         $this->p = 0;
     }
     if (isset(self::$cookie->nb_item_per_page) and $this->n != self::$cookie->nb_item_per_page and in_array($this->n, $nArray)) {
         self::$cookie->nb_item_per_page = $this->n;
     }
     if ($this->p > $nbProducts / $this->n + 1) {
         $this->p = 1;
     }
     $pages_nb = ceil($nbProducts / (int) $this->n);
     $start = (int) ($this->p - $range);
     if ($start < 1) {
         $start = 1;
     }
     $stop = (int) ($this->p + $range);
     if ($stop > $pages_nb) {
         $stop = (int) $pages_nb;
     }
     self::$smarty->assign('nb_products', $nbProducts);
     $pagination_infos = array('products_per_page' => (int) Configuration::get('TAS_ITEMS_PER_PAGE'), 'pages_nb' => $pages_nb, 'p' => $this->p, 'n' => $this->n, 'nArray' => $nArray, 'range' => $range, 'start' => $start, 'stop' => $stop, 'current_url' => $current_url);
     self::$smarty->assign($pagination_infos);
 }
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:38,代码来源:FrontController.php


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