本文整理汇总了PHP中Pages::getPageByAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::getPageByAlias方法的具体用法?PHP Pages::getPageByAlias怎么用?PHP Pages::getPageByAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::getPageByAlias方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</div><!-- top 轮播 -->
<!-- start content -->
<div id="container cleard" style="margin-top:-30px; position:relative; z-index:10;" class="clearfix">
<div class="content">
<div class="cleard">
<div style="float:left;padding:0;width:325px;height:320px;border:none;" class="p-ib">
<div style="background:#066CB8;padding:10px 10px 0 10px;" class="lineTitleBox2">
<p class="">新闻动态<span> NEWS <i></i></span><a style="color:#fff;" href="/page/xinwendongtai">more >></a></p>
</div>
<div style="padding:8px 8px 10px;border:1px solid #D6D6D6;" class="p-ibb p-ibbox">
<ul>
<?php
$news_page = Pages::getPageByAlias('工作信息简报');
?>
@foreach($news_page->posts()->limit(10)->get() as $new)
<li><i></i> <a href="/page/xinwendongtai/工作信息简报/{{ $new->title }}">{{$new->title}}</a></li>
@endforeach
</ul>
</div>
</div>
<div class="topLeft">
<div style="background:#E2610A;padding:10px 10px 0 10px;" class="lineTitleBox2">
<p class="">走进园区<span> PARK <i style="border-top:4px solid #E2610A;border-bottom:4px solid #E2610A;border-right:4px solid #E2610A;"></i></span><a style="color:#fff;" href="javascript:;">more >></a></p>
</div>
<div class="videoHome cleard">
<div class="news_img">
<div id="czjimgnews">
<div id="czjimgnewsContent">
示例2:
@extends('qz.layout')
@section('title')
<?php
$page = Pages::getPageByAlias($alias);
if (!$child) {
$child = Pages::getFirstSubPage($page->id);
} else {
$child = Pages::getPageByAlias($child);
}
$hasChild = $child ? true : false;
if ($post) {
$postRow = Posts::where('alias', $post)->first();
}
?>
{{ $post&&isset($postRow) ? $postRow->title : ''}}
{{$page->title}}
{{$hasChild ? $child->title : ''}}
@endsection
@section('links')
@endsection
@section('content')
<div class="lunbo-box cleard">
<img src="/vendor/qz/images/top-3.jpg" height="400" width="100%" alt="" />
</div><!-- top 轮播 -->
<!-- start content -->
示例3: sitemap
public function sitemap()
{
$pages = Pages::whereParentId(0)->where('published_at', '<', date('Y-m-d H:i:s'))->where('is_published', 1)->with('children')->get(['id', 'published_at', 'is_published', 'alias', 'menu_title', 'title']);
View::share('model', Pages::getPageByAlias('karta-sajta'));
return View::make('sitemap')->with('pages', $pages);
}