本文整理汇总了PHP中Vendor::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Vendor::all方法的具体用法?PHP Vendor::all怎么用?PHP Vendor::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vendor
的用法示例。
在下文中一共展示了Vendor::all方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
try {
$vendorList = Vendor::all();
//venNum will be used for css coloring
$vendorNumber = 0;
foreach ($vendorList as $vendor) {
$vendor->venNum = $vendorNumber;
$vendorNumber++;
}
return $vendorList->toJson();
} catch (Exception $e) {
return '{"error":{"text":' . $e->getMessage() . '}}';
}
}
示例2: update
public static function update($id)
{
self::check_logged_in();
$params = $_POST;
$attributes = array('id' => $id, 'vendor_id' => $params['vendor_id'], 'partnumber' => $params['partnumber'], 'datasheeturl' => $params['datasheeturl']);
$vendoritem = new VendorItem($attributes);
$errors = $vendoritem->errors();
if (count($errors) > 0) {
$vendoritem = VendorItem::find($id);
$vendors = Vendor::all();
View::make('vendoritem/edit.html', array('errors' => $errors, 'attributes' => $attributes, 'vendoritem' => $vendoritem, 'vendors' => $vendors));
} else {
$vendoritem->update();
Redirect::to('/vendoritem/' . $vendoritem->id, array('message' => 'The vendor item has been modified successfully!'));
}
}
示例3: run
public function run()
{
foreach (Vendor::all() as $vendor) {
$vendor->sync_with_dsbs_and_sam();
}
}
示例4: require_login
<?php
include_once '../../../_includes/framework.php';
require_login();
if (!isset($form)) {
$form = new AddAttendeeForm();
}
$badge_types = BadgeType::all();
$reg_levels = RegistrationLevel::all();
$tshirt_sizes = TShirtSize::all();
$payment_types = PaymentType::all();
$vendors = Vendor::all();
?>
<div class="row">
<div class="form-group col-md-6 <?php
echo $form->error_on("badge_name") ? "has-error" : "";
?>
">
<?php
echo label_tag("badge_name", "Badge Name");
?>
<?php
echo input_tag($form, "badge_name");
?>
<?php
echo error_display($form, "badge_name");
?>
</div>
<div class="form-group col-md-6 <?php
示例5: edit
/**
* Show the form for editing the specified product.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$product = Product::find($id);
$vendors = Vendor::all();
return View::make('products.edit', compact('product', 'vendors'));
}
示例6: allVendors
public function allVendors()
{
$data = array('status' => 'ok', 'vendors' => Vendor::all());
return $data;
}
示例7: index
public function index()
{
$vendors = Vendor::all();
return View::make('admin.vendors.index', compact('vendors'));
}
示例8: require_login
<?php
include_once '../_includes/framework.php';
require_login();
$page_title = "Admin";
include "_partials/admin-header.php";
$query = Vendor::all();
$count = count($query);
?>
<div class="container">
<div class="col-md-12">
<h1>
Vendors (<?php
echo $count;
?>
)
</h1>
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Assigned Table(s)</th>
<th class="hidden-print">Badges</th>
</tr>
</thead>
<tbody>
<?php
foreach ($query as $vendor) {
?>
<tr data-id="<?php
示例9: error_display
<?php
echo error_display($form, "badge_type");
?>
</div>
<div class="form-group col-md-4 <?php
echo $form->error_on("vendor_id") ? "has-error" : "";
?>
">
<?php
echo label_tag("vendor_id", "Vendor");
?>
<select class="form-control" id="vendor_id" name="vendor_id">
<option></option>
<?php
foreach (Vendor::all() as $vendor) {
?>
<?php
echo option_tag($vendor->display_name(), @$form->params["vendor_id"], $vendor->id);
?>
<?php
}
?>
</select>
<?php
echo error_display($form, "vendor_id");
?>
</div>
</div>
<div class="row">
示例10: index
public static function index()
{
$vendors = Vendor::all();
View::make('vendor/index.html', array('vendors' => $vendors));
}