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


PHP Restaurant::getCategories方法代碼示例

本文整理匯總了PHP中Restaurant::getCategories方法的典型用法代碼示例。如果您正苦於以下問題:PHP Restaurant::getCategories方法的具體用法?PHP Restaurant::getCategories怎麽用?PHP Restaurant::getCategories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Restaurant的用法示例。


在下文中一共展示了Restaurant::getCategories方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Recommendation

include "inc/includes.php";
require_once "inc/Restaurant.php";
require_once "inc/Cuisine.php";
require_once "inc/Filter.php";
global $USER_LOGGED_IN;
global $USERID;
// Generate the default recommendations if user is logged in.
if ($USER_LOGGED_IN) {
    $recommendation = new Recommendation($USERID);
    $filter = new Filter();
    $filter->setCuisine(7);
    $result = $recommendation->getFilteredWithCategory(2, $filter);
    while ($reco = mysql_fetch_array($result)) {
        $restaurant = new Restaurant($reco['resId']);
        echo $restaurant->getName() . "," . $restaurant->getAddress();
        $cuisines = $restaurant->getCategories();
        foreach ($cuisines as $cuisine) {
            echo $cuisine->getName();
        }
    }
}
?>
<html>
  <body>
  <?php 
getFacebookWidget();
?>
  </body>
</html>
開發者ID:jainankit,項目名稱:suggstme,代碼行數:29,代碼來源:fb.php

示例2: Restaurant

		</div>
		<div>
			<div class="checkbox-wrapper"><input type="checkbox" name="delievery" value="true" /> Home Delievery</div>
			<div class="checkbox-wrapper"><input type="checkbox" name="pureveg" value="true" /> Pure Vegetarian</div>
			<div class="checkbox-wrapper"><input type="checkbox" name="reservation" value="true" /> Takes Reservations</div>
		</div>
		<div class="single-block">
			<a href="#" class="button black">Filter</a>
		</div>
	</div>
</div>
<?php 
while ($reco = mysql_fetch_array($results)) {
    $restaurant = new Restaurant($reco['resId']);
    $cuisines = $restaurant->getCuisines();
    $categories = $restaurant->getCategories();
    ?>
<div class="item normal" data-order='1'>

	<!--BEGIN .hentry -->
	<div class="hentry">

		<!--BEGIN .featured-image -->
		<div class="featured-image">
				
			<a href="#"><img src="http://demo.designerthemes.com/construct/files/2011/04/3995799932_8fed63e2fc_o1-300x180.jpg" width="300" height="180" alt="" /></a>
			
		<!--END .featured-image -->
		</div>
	<span class="meta-category icon-video">
		<?php 
開發者ID:jainankit,項目名稱:suggstme,代碼行數:31,代碼來源:search.php

示例3: foreach

        if ($counter++ != 0) {
            echo ", ";
        }
        ?>
<span class="meta-category"><?php 
        echo $cuisine->getName();
        ?>
</span><?php 
    }
    ?>
				<!--BEGIN .featured-post-content -->
				<div class="featured-post-content">
					<div class="featued-single-block">
						<?php 
    $counter = 0;
    foreach ($restaurant->getCategories() as $category) {
        if ($couter++ != 0) {
            echo ", ";
        }
        ?>
<span class="category">
								<a href="restaurant.php?id=<?php 
        echo $category->getCategoryId();
        ?>
" label="get recommendations for <?php 
        echo $category->getName();
        ?>
"><?php 
        echo $category->getName();
        ?>
</a></span><?php 
開發者ID:jainankit,項目名稱:suggstme,代碼行數:31,代碼來源:restaurant.php


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