本文整理汇总了PHP中app\models\Category::getFullCategoriesList方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getFullCategoriesList方法的具体用法?PHP Category::getFullCategoriesList怎么用?PHP Category::getFullCategoriesList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Category
的用法示例。
在下文中一共展示了Category::getFullCategoriesList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show(Label $labelModel, History $historyModel, Purchase $purchaseModel, Provider $providerController, Brand $brandModel, Category $categoryModel, Product $productModel, $id)
{
$product = $productModel->getProduct($id);
if (!$product) {
abort(404);
}
$purchase = $purchaseModel->getPurchase($id);
$historyProduct = $historyModel->getProductHistory($id);
$historyPurchase = $historyModel->getPurchaseHistory($id);
$historySite = $historyModel->getSiteHistory($id);
$labels = $labelModel->getLabelsByProductsId([$id]);
$arLabels = [];
foreach ($labels as $label) {
$arLabels[] = $label->label;
}
$strLabels = implode(',', $arLabels);
if (!empty($product->childs)) {
$product->childs = unserialize($product->childs);
}
$categories_list = $categoryModel->getFullCategoriesList();
$brands_list = $brandModel->getFullBrandsList();
$provider_list = $providerController->getProvedrsList();
return view('products.show')->with('title', $product->category_name . ' ' . $product->name)->with('product', $product)->with('purchase', $purchase)->with('categories_list', $categories_list)->with('brands_list', $brands_list)->with('provider_list', $provider_list)->with('history_product', $historyProduct)->with('history_purchase', $historyPurchase)->with('history_site', $historySite)->with('labels', $strLabels);
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id, Category $categoryModel, Provider $providerModel)
{
if (!right('EditCategory')) {
abort(404);
}
$category = $categoryModel->getCategory($id);
if (count($category) < 1) {
abort(404);
}
$fullList = $categoryModel->getFullCategoriesList();
$providers_list = $providerModel->getExistInCategoryProvedrsList($id);
$chain = $categoryModel->getParents($id);
return view('category.edit')->with('title', 'Редактирование категории ' . $category->name)->with('category', $category)->with('chain', $chain)->with('fullList', $fullList)->with('provider_list', $providers_list)->with('current_id', $id);
}