当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::whereSlug方法代码示例

本文整理汇总了PHP中app\Page::whereSlug方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::whereSlug方法的具体用法?PHP Page::whereSlug怎么用?PHP Page::whereSlug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Page的用法示例。


在下文中一共展示了Page::whereSlug方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $cats = \App\Category::where('status', 1)->where('parent_id', 0)->orderBy('order')->get();
     $prods = \App\Product::where('status', 1)->where('category_id', 0)->orderBy('order')->get();
     if ($cats) {
         $data['items'] = $cats->merge($prods);
     } else {
         $data['items'] = $prods;
     }
     $data['seo'] = \App\Page::whereSlug('vorur')->first();
     $data['pagetitle'] = 'Vörur';
     return view('frontend.products')->with($data);
 }
开发者ID:stjanilofts,项目名称:cp,代码行数:13,代码来源:VorukerfiController.php

示例2:

@extends('frontend.layout')

@section('content')

	<?php 
$rootPage = \App\Page::whereSlug(\Request::segment(1))->first();
?>

	<div class="Page padded">
		<div class="Page__crumbs padded-bottom">
			<div class="uk-container uk-container-center">
				<div class="uk-width-1-1">
					@include('frontend._crumbs', ['crumbs' => $crumbs])
				</div>
			</div>
		</div>
		<div class="uk-container uk-container-center">
			@if($rootPage->hasSubs())
				<div class="uk-grid" data-uk-grid-margin data-uk-grid-match>
					<div class="uk-width-large-1-5 uk-width-medium-1-4">
						<div class="Subnav">
							@include('frontend._subnav')
						</div>
					</div>

					<div class="uk-width-large-4-5 uk-width-medium-3-4">
						@include('frontend._page', ['page' => $page])
					</div>
				</div>
			@else
				@include('frontend._page', ['page' => $page])
开发者ID:snudur,项目名称:nvcms,代码行数:31,代码来源:page.blade.php

示例3: cards

 public function cards()
 {
     // Hérna eru boxin á forsíðu valin
     $cards = [];
     // Um SFH
     $card1 = Page::whereSlug('um-sfh')->first() ?: false;
     if ($card1) {
         $cards[] = ['title' => $card1->title, 'content' => shortenClean($card1->content), 'path' => rtrim($card1->path, '/'), 'icon' => 'fa-question'];
     }
     // Aðilar að SFH
     $card2 = Page::whereSlug('adilar-ad-sfh')->first() ?: false;
     if ($card2) {
         $cards[] = ['title' => $card2->title, 'content' => shortenClean($card2->content), 'path' => rtrim($card2->path, '/'), 'icon' => 'fa-users'];
     }
     // Hafa samband
     $card3 = Page::whereSlug('gjaldskrar')->first() ?: false;
     if ($card3) {
         $cards[] = ['title' => $card3->title, 'content' => shortenClean($card3->content), 'path' => rtrim($card3->path, '/'), 'icon' => 'fa-money'];
     }
     // Hafa samband
     $card4 = Page::whereSlug('hafa-samband')->first() ?: false;
     if ($card4) {
         $cards[] = ['title' => $card4->title, 'content' => shortenClean($card4->content), 'path' => rtrim($card4->path, '/'), 'icon' => 'fa-envelope'];
     }
     return $cards;
 }
开发者ID:stjanilofts,项目名称:normx,代码行数:26,代码来源:ApiController.php

示例4: show

 public function show($slug)
 {
     $page = Page::whereSlug($slug)->firstOrFail();
     $related_pages = Page::where('slug', '!=', $slug)->take(5)->get();
     return view('pages.show')->with('page', $page)->with('related_pages', $related_pages);
 }
开发者ID:Gadurp1,项目名称:KD-2,代码行数:6,代码来源:PagesController.php

示例5: getBySlug

 public function getBySlug($slug)
 {
     $page = Page::whereSlug($slug)->with(['translations', 'children', 'parent'])->first();
     return $page;
 }
开发者ID:manogi,项目名称:gfw-qm,代码行数:5,代码来源:EloquentPageRepository.php

示例6: lifeAtTeleaus

 /**
  * Life at Teleaus page
  *
  * @return $this
  */
 public function lifeAtTeleaus()
 {
     $page = Page::whereSlug('life-at-teleaus')->get()->first();
     $contents = $page->contents;
     $data = ['parentPage' => 'Career', 'page' => 'Life At Teleaus', 'title' => 'Teleaus | Life At Teleaus', 'content' => $page, 'data' => $contents];
     return view('life-at-teleaus')->with($data);
 }
开发者ID:minhajCSE,项目名称:teleaus-dev,代码行数:12,代码来源:HomeController.php


注:本文中的app\Page::whereSlug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。