本文整理汇总了PHP中Store::getCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::getCategory方法的具体用法?PHP Store::getCategory怎么用?PHP Store::getCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Store
的用法示例。
在下文中一共展示了Store::getCategory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUpdate
function testUpdate()
{
//Arrange
$store_name = "Chill N Fill";
$id = 1;
$category = "bar";
$region = "North Portland";
$address = "5215 N Lombard Portland, OR 97203";
$test_store = new Store($store_name, $category, $region, $address, $id);
$test_store->save();
$new_store_name = "Fill N Chill";
$new_category = "bottleshop";
$new_region = "SW Portland";
$new_address = "5215 N Chautauqua Blvd Portland, OR 97203";
//Act
$test_store->update($new_store_name, $new_category, $new_region, $new_address);
//Assert
$this->assertEquals("Fill N Chill", $test_store->getStoreName());
$this->assertEquals("bottleshop", $test_store->getCategory());
$this->assertEquals("SW Portland", $test_store->getRegion());
$this->assertEquals("5215 N Chautauqua Blvd Portland, OR 97203", $test_store->getAddress());
}
示例2: Store
<!-- Header -->
<header id="header" role="heading">
<div class="sf-contener clearfix ">
<nav class="nav-wrap container_9">
<ul class="sf-menu clearfix ">
<li class="first-logo-item "><a title="Shoppik" href="home.php" class="logo "><img width="145" height="59" alt="logo" src="media/logo.jpg"></a></li>
<?php
$store = new Store($db);
$categories = $store->getCategory();
foreach ($categories as $category) {
echo '<li><a href="product-grid.php?idCategory=' . $category['id_categorie'] . '">' . str_replace(' ', '<br>', utf8_encode($category['libelle_cat'])) . '</a>
<ul>';
$subCategories = $store->getSubCategoryByIdCategory($category['id_categorie']);
echo '<li></li>';
foreach ($subCategories as $subCategory) {
echo '<li><a href="product-grid2.php?idSubCategory=' . $subCategory['id_ss_categorie'] . '">' . utf8_encode($subCategory['libelle_ss_categorie']) . '</a></li>';
}
echo ' </ul>
</li>';
}
?>
<li style="float:right" class="sf-search noBack">
<form method="get" id="searchbox" action="search-grid.php">
<input type="text" placeholder="Rechercher" value="" name="search_query">
</form>
</li>
</ul>
</nav>
</div>
</header>