當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Store::getCategory方法代碼示例

本文整理匯總了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());
 }
開發者ID:bborealis,項目名稱:growler,代碼行數:22,代碼來源:StoreTest.php

示例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>
開發者ID:ejesoda,項目名稱:ejesoda,代碼行數:31,代碼來源:header.php


注:本文中的Store::getCategory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。