本文整理汇总了PHP中Catalog::GetDepartmentName方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::GetDepartmentName方法的具体用法?PHP Catalog::GetDepartmentName怎么用?PHP Catalog::GetDepartmentName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::GetDepartmentName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _GetPageTitle
private function _GetPageTitle()
{
$page_title = 'TShirtShop: ' . 'Demo Product Catalog from Beginning PHP and MySQL E-Commerce';
if (isset($_GET['DepartmentId']) && isset($_GET['CategoryId'])) {
$page_title = 'TShirtShop: ' . Catalog::GetDepartmentName($_GET['DepartmentId']) . ' - ' . Catalog::GetCategoryName($_GET['CategoryId']);
if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) {
$page_title .= ' - Page ' . (int) $_GET['Page'];
}
} elseif (isset($_GET['DepartmentId'])) {
$page_title = 'TShirtShop: ' . Catalog::GetDepartmentName($_GET['DepartmentId']);
if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) {
$page_title .= ' - Page ' . (int) $_GET['Page'];
}
} elseif (isset($_GET['ProductId'])) {
$page_title = 'TShirtShop: ' . Catalog::GetProductName($_GET['ProductId']);
} elseif (isset($_GET['SearchResults'])) {
$page_title = 'TShirtShop: "';
// Display the search string
$page_title .= trim(str_replace('-', ' ', $_GET['SearchString'])) . '" (';
// Display "all-words search " or "any-words search"
$all_words = isset($_GET['AllWords']) ? $_GET['AllWords'] : 'off';
$page_title .= ($all_words == 'on' ? 'all' : 'any') . '-words search';
// Display page number
if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) {
$page_title .= ', page ' . (int) $_GET['Page'];
}
$page_title .= ')';
} else {
if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) {
$page_title .= ' - Page ' . (int) $_GET['Page'];
}
}
return $page_title;
}
示例2: ToCategory
public static function ToCategory($departmentId, $categoryId, $page = 1)
{
$link = self::CleanUrlText(Catalog::GetDepartmentName($departmentId)) . '-d' . $departmentId . '/' . self::CleanUrlText(Catalog::GetCategoryName($categoryId)) . '-c' . $categoryId . '/';
if ($page > 1) {
$link .= 'page-' . $page . '/';
}
return self::Build($link);
}