本文整理匯總了PHP中Vendor::readAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vendor::readAll方法的具體用法?PHP Vendor::readAll怎麽用?PHP Vendor::readAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vendor
的用法示例。
在下文中一共展示了Vendor::readAll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
<?php
require_once dirname(__FILE__) . '/../vendor/autoload.php';
//autoload packages
$db = new Database();
$item = new Item($db->conn);
$vendor = new Vendor($db->conn);
$category = new Category($db->conn);
$vendors = $vendor->readAll();
$categories = $category->readAll();
//dump($vendors);
if ($_POST) {
//dump($_FILES);
$item->name = $_POST['name'];
$item->article = $_POST['article'];
$item->vendor_id = $_POST['vendor_id'];
$item->category_id = $_POST['category_id'];
$item->images = json_encode($_FILES['images']['name']);
$item->status = isset($_POST['status']) ? 1 : 0;
$num = 0;
foreach ($_FILES['images']['name'] as $file) {
upload('images', $num, 'items');
$num++;
}
//exit;
$state = false;
if ($item->add()) {
$state = true;
unset($_POST);
}
}
示例2: dirname
<?php
require_once dirname(__FILE__) . '/../vendor/autoload.php';
//autoload packages
$db = new Database();
$vendor = new Vendor($db->conn);
$stmt = $vendor->readAll();
$num = $stmt->rowCount();
include 'templates/header.php';
include 'templates/sidemenu.php';
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
List Users
<small>Manage Users In The System</small>
</h1>
<ol class="breadcrumb">
<li><a href="./"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="#"><i class="fa fa-users"></i> Vendors</a></li>
<li class="active">List Vendors</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->