本文整理汇总了PHP中Breadcrumbs::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP Breadcrumbs::generate方法的具体用法?PHP Breadcrumbs::generate怎么用?PHP Breadcrumbs::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Breadcrumbs
的用法示例。
在下文中一共展示了Breadcrumbs::generate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGenerate
public function testGenerate()
{
$breadcrumbs = Breadcrumbs::generate('post', $this->post);
$this->assertCount(3, $breadcrumbs);
$this->assertSame('Home', $breadcrumbs[0]->title);
$this->assertSame('/', $breadcrumbs[0]->url);
$this->assertTrue($breadcrumbs[0]->first);
$this->assertFalse($breadcrumbs[0]->last);
$this->assertSame('Sample Category', $breadcrumbs[1]->title);
$this->assertSame('/category/456', $breadcrumbs[1]->url);
$this->assertFalse($breadcrumbs[1]->first);
$this->assertFalse($breadcrumbs[1]->last);
$this->assertSame('Sample Post', $breadcrumbs[2]->title);
$this->assertSame('/blog/123', $breadcrumbs[2]->url);
$this->assertFalse($breadcrumbs[2]->first);
$this->assertTrue($breadcrumbs[2]->last);
}
示例2: substr
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LaravelLocalization::getCurrentLangCode() }}">
<head>
<?php
$b = Breadcrumbs::generate();
?>
<title>{{ (Route::currentRouteName() == 'home') ? trans('general.main-description') : end($b)->title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="<?php
echo substr(trim($__env->yieldContent('description')), 0, 155);
?>
" />
<meta name="keywords" content="<?php
echo substr(trim($__env->yieldContent('keywords')), 0, 155);
?>
" />
<meta name="Author" content="Your name" />
<meta name="Robots" content="index,follow">
<meta name="revisit-after" content="1 days">
<link rel="author" href="https://plus.google.com/114183900135001854492" />
<link type="text/css" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="{{ URL::asset('assets/css/jquery.cookiebar.css') }}" />
<link type="text/css" rel="stylesheet" href="{{ URL::asset('assets/css/style.css?v=1.1.4') }}" />
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>