本文整理汇总了PHP中app\models\Category::getParents方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getParents方法的具体用法?PHP Category::getParents怎么用?PHP Category::getParents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Category
的用法示例。
在下文中一共展示了Category::getParents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categoryIndex
public function categoryIndex(Category $categoryModel, $category_id, $provider_id = false)
{
$ids = $categoryModel->getChild($category_id);
$chain = $categoryModel->getParents($category_id);
return $this->buildIndex('category', $ids, $chain, false, $provider_id);
}
示例2: categoryIndex
public function categoryIndex(Category $categoryModel, $id)
{
$ids = $categoryModel->getChild($id);
$chain = $categoryModel->getParents($id);
return $this->buildIndex('category', $ids, $chain);
}
示例3: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create(Category $category)
{
return view('category.create', ['data' => $category->getParents()]);
}
示例4: 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);
}