当前位置: 首页>>代码示例>>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;未经允许,请勿转载。