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


PHP Link::QueryStringToArray方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->mLinkToSearch = Link::ToSearch();
     if (isset($_GET['Search'])) {
         $this->mSearchString = trim($_POST['search_string']);
         $this->mAllWords = isset($_POST['all_words']) ? $_POST['all_words'] : 'off';
         //Очищаем буфер вывода
         ob_clean;
         //Перенаправление с кодом 302
         header('HTTP/1.1 302 Found');
         header('Location: ' . Link::ToSearchResults($this->mSearchString, $this->mAllWords));
         //Очищаем буфер вывода и останавливаем выполнение
         flush();
         ob_flush();
         ob_end_clean();
         exit;
     } elseif (isset($_GET['SearchResults'])) {
         $this->mSearchString = trim(str_replace('-', ' ', $_GET['SearchString']));
         $this->mAllWords = isset($_GET['AllWords']) ? $_GET['AllWords'] : 'off';
     }
     if (isset($_GET['ProductId']) && isset($_SESSION['link_to_continue_shopping'])) {
         $continue_shopping = Link::QueryStringToArray($_SESSION['link_to_continue_shopping']);
         if (isset($continue_shopping['SearchResults'])) {
             $this->mSearchString = trim(str_replace('-', ' ', $continue_shopping['SearchString']));
             $this->mAllWords = $continue_shopping['AllWords'];
         }
     }
 }
开发者ID:naOyD,项目名称:tshirtshop_g,代码行数:28,代码来源:search_box.php

示例2: __construct

 public function __construct()
 {
     /* Если в строке запроса есть DepartmentId, мы посещаем отдел*/
     if (isset($_GET['DepartmentId'])) {
         $this->mSelectedDepartment = (int) $_GET['DepartmentId'];
     } elseif (isset($_GET['ProductId']) && isset($_SESSION['link_to_continue_shopping'])) {
         $continue_shopping = Link::QueryStringToArray($_SESSION['link_to_continue_shopping']);
         if (array_key_exists('DepartmentId', $continue_shopping)) {
             $this->mSelectedDepartment = (int) $continue_shopping['DepartmentId'];
         }
     }
 }
开发者ID:naOyD,项目名称:tshirtshop_g,代码行数:12,代码来源:departments_list.php

示例3: __construct

 public function __construct()
 {
     /* If DepartmentId exists in the query string, we're visiting a department */
     if (isset($_GET['DepartmentId'])) {
         $this->mSelectedDepartment = (int) $_GET['DepartmentId'];
     } elseif (isset($_GET['ProductId']) && isset($_SESSION['link_to_continue_shopping'])) {
         // Does not choose department --> check department of the product
         $continue_shopping = Link::QueryStringToArray($_SESSION['link_to_continue_shopping']);
         // if yes --> we're visiting this department to continue shopping
         if (array_key_exists('DepartmentId', $continue_shopping)) {
             $this->mSelectedDepartment = (int) $continue_shopping['DepartmentId'];
         }
     }
 }
开发者ID:huynhchanhuy,项目名称:tshirtshop,代码行数:14,代码来源:departments_list.php

示例4: init

 public function init()
 {
     // Get product details from business tier
     $this->mProduct = Catalog::GetProductDetails($this->_mProductId);
     if (isset($_SESSION['link_to_continue_shopping'])) {
         $continue_shopping = Link::QueryStringToArray($_SESSION['link_to_continue_shopping']);
         $page = 1;
         if (isset($continue_shopping['Page'])) {
             $page = (int) $continue_shopping['Page'];
         }
         if (isset($continue_shopping['CategoryId'])) {
             $this->mLinkToContinueShopping = Link::ToCategory((int) $continue_shopping['DepartmentId'], (int) $continue_shopping['CategoryId'], $page);
         } elseif (isset($continue_shopping['DepartmentId'])) {
             $this->mLinkToContinueShopping = Link::ToDepartment((int) $continue_shopping['DepartmentId'], $page);
         } elseif (isset($continue_shopping['SearchResults'])) {
             $this->mLinkToContinueShopping = Link::ToSearchResults(trim(str_replace('-', ' ', $continue_shopping['SearchString'])), $continue_shopping['AllWords'], $page);
         } else {
             $this->mLinkToContinueShopping = Link::ToIndex($page);
         }
     }
     if ($this->mProduct['image']) {
         $this->mProduct['image'] = Link::Build('images/product_images/' . $this->mProduct['image']);
     }
     if ($this->mProduct['image_2']) {
         $this->mProduct['image_2'] = Link::Build('images/product_images/' . $this->mProduct['image_2']);
     }
     $this->mProduct['attributes'] = Catalog::GetProductAttributes($this->mProduct['product_id']);
     $this->mLocations = Catalog::GetProductLocations($this->_mProductId);
     // Create the Add to Cart link
     $this->mProduct['link_to_add_product'] = Link::ToCart(ADD_PRODUCT, $this->_mProductId);
     // Build links for product departments and categories pages
     for ($i = 0; $i < count($this->mLocations); $i++) {
         $this->mLocations[$i]['link_to_department'] = Link::ToDepartment($this->mLocations[$i]['department_id']);
         $this->mLocations[$i]['link_to_category'] = Link::ToCategory($this->mLocations[$i]['department_id'], $this->mLocations[$i]['category_id']);
     }
     // Подготавливаем кнопу редактирования
     $this->mEditActionTarget = Link::Build(str_replace(VIRTUAL_LOCATION, '', getenv('REQUEST_URI')));
     if (isset($_SESSION['admin_logged']) && $_SESSION['admin_logged'] == TRUE && isset($_POST['submit_edit'])) {
         $product_locations = $this->mLocations;
         if (count($product_locations) > 0) {
             $department_id = $product_locations[0]['department_id'];
             $category_id = $product_locations[0]['category_id'];
             header('Location: ' . htmlspecialchars_decode(Link::ToProductAdmin($department_id, $category_id, $this->_mProductId)));
         }
     }
 }
开发者ID:naOyD,项目名称:tshirtshop_g,代码行数:46,代码来源:product.php

示例5: __construct

 public function __construct()
 {
     if (!isset($_GET['ProductId'])) {
         if (isset($_GET['DepartmentId'])) {
             $this->mSelectedDepartment = (int) $_GET['DepartmentId'];
         } else {
             trigger_error("DepartmentId not set");
         }
         if (isset($_GET['CategoryId'])) {
             $this->mSelectedCategory = (int) $_GET['CategoryId'];
         }
     } else {
         $continue_shopping = Link::QueryStringToArray($_SESSION['link_to_continue_shopping']);
         if (array_key_exists('DepartmentId', $continue_shopping)) {
             $this->mSelectedDepartment = (int) $continue_shopping['DepartmentId'];
         } else {
             trigger_error('DepartmentId not set');
         }
         if (array_key_exists('CategoryId', $continue_shopping)) {
             $this->mSelectedCategory = (int) $continue_shopping['CategoryId'];
         }
     }
 }
开发者ID:huynhchanhuy,项目名称:tshirtshop,代码行数:23,代码来源:categories_list.php

示例6: init

 public function init()
 {
     // Get product details from business tier
     $this->mProduct = Catalog::GetProductDetails($this->_mProductId);
     // Session Handle
     if (isset($_SESSION['link_to_continue_shopping'])) {
         $continue_shopping = Link::QueryStringToArray($_SESSION['link_to_continue_shopping']);
         $page = 1;
         // Cache the current query string. Then after choose the product, we will get back this page.
         if (isset($continue_shopping['Page'])) {
             $page = (int) $continue_shopping['Page'];
         }
         if (isset($continue_shopping['CategoryId'])) {
             $this->mLinkToContinueShopping = Link::ToCategory((int) $continue_shopping['DepartmentId'], (int) $continue_shopping['CategoryId'], $page);
         } elseif (isset($continue_shopping['DepartmentId'])) {
             $this->mLinkToContinueShopping = Link::ToDepartment((int) $continue_shopping['DepartmentId'], $page);
         } else {
             $this->mLinkToContinueShopping = Link::ToIndex($page);
         }
     }
     // Product detail
     if ($this->mProduct['image']) {
         $this->mProduct['image'] = Link::Build('images/product_images/' . $this->mProduct['image']);
     }
     if ($this->mProduct['image_2']) {
         $this->mProduct['image_2'] = Link::Build('images/product_images/' . $this->mProduct['image_2']);
     }
     $this->mProduct['attributes'] = Catalog::GetProductAttributes($this->mProduct['product_id']);
     // Similar products in catalog
     $this->mLocations = Catalog::GetProductLocations($this->_mProductId);
     // Build links for product departments and categories pages
     for ($i = 0; $i < count($this->mLocations); $i++) {
         $this->mLocations[$i]['link_to_department'] = Link::ToDepartment($this->mLocations[$i]['department_id']);
         $this->mLocations[$i]['link_to_category'] = Link::ToCategory($this->mLocations[$i]['department_id'], $this->mLocations[$i]['category_id']);
     }
 }
开发者ID:huynhchanhuy,项目名称:tshirtshop,代码行数:36,代码来源:product.php


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