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


PHP Products::listProducts方法代碼示例

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


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

示例1: isset

        break;
        // add to shopping cart
    // add to shopping cart
    case "add_to_cart":
        if (isset($_POST['product_id'])) {
            // we always add one piece for now
            $qt = isset($_POST['qt']) ? $_POST['qt'] : 1;
            $shopping_cart->addProduct($_POST['product_id'], $qt);
        }
        // we don't have the break here on purpose so that the code continues
        // with displaying the contents of the shopping cart
        //break;
        // shopping cart
    // we don't have the break here on purpose so that the code continues
    // with displaying the contents of the shopping cart
    //break;
    // shopping cart
    case "show_cart":
        $product_list = $shopping_cart->getContents();
        $smarty->assign("products", $product_list);
        $smarty->assign("items", $products->listProducts());
        $smarty->display("cart.tpl");
        break;
        // index page
    // index page
    default:
        $product_list = $products->listProducts();
        $smarty->assign("products", $product_list);
        $smarty->display("index.tpl");
        break;
}
開發者ID:nikoca,項目名稱:WebProgUiS,代碼行數:31,代碼來源:index.php

示例2: json_encode

<?php

require_once "../helper.php";
require_once "../classes/Products.class.php";
require_once "../classes/Company.class.php";
$helper = new Helper();
$productObj = new Products();
$companyObj = new Company();
if (($result = $companyObj->checkLoggedIn()) && !isset($result['error'])) {
    $result = $productObj->listProducts($result['company_id']);
}
echo json_encode($result);
?>
	
開發者ID:prasanthkumara,項目名稱:samyug_v1,代碼行數:13,代碼來源:productList.php

示例3: array

<?php

$games = array();
$items = new Products();
$games = $items->listProducts();
if (isset($_GET['id'])) {
    $document['template'] = 'game';
    $game = $items->getProduct($_GET['id']);
    $product = Gameservices::validateGame($game);
    $smarty->assign('game', $product);
} else {
    $document['template'] = 'games';
    /*********Games For View************/
    foreach ($games as $value) {
        $products[] = Gameservices::validateGameList($value);
    }
    /********************************/
    $smarty->assign('games', $products);
}
?>
	
開發者ID:LozaVolodymyr,項目名稱:Parsing,代碼行數:20,代碼來源:games.php


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