本文整理汇总了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 -->