sukohi/page-title 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sukohi/page-title

Composer 安装命令:

composer require sukohi/page-title

包简介

Your package description here.

README 文档

README

A Laravel package to manage page title based on route name.
(This is for Laravel 5+. For Laravel 4.2)

Installation

Execute composer command.

composer require sukohi/page-title:2.*

Register the service provider in app.php

'providers' => [
    ...Others...,  
    Sukohi\PageTitle\PageTitleServiceProvider::class,
]

Also alias

'aliases' => [
    ...Others...,  
    'PageTitle' => Sukohi\PageTitle\Facades\PageTitle::class,
]

And then execute the next command to publish the view

php artisan vendor:publish

Preparation

Set configuration values in config/page-title.php.

e.g)

return [
	'patterns' => [
		'key.mode' => '{key} - {mode}',
		'mode.key' => '{mode} - {key}',
	],
	'replacements' => [
		'key' => [
			'item' => 'Item',
			'address' => 'Address',
			'user' => 'User'
		],
		'mode' => [
			'index' => 'List',
			'create' => 'Insert',
			'edit' => 'Update',
			'show' => 'Confirmation'
		]
	]
];

In this case, for instance, if current route is item.index the page title you will get is Item - List.

Usage

$page_title = PageTitle::get();

You can specify pattern name like this.

$page_title = PageTitle::get('mode.key');

You also can set specific route name.

$page_title = PageTitle::get('mode.key', 'address.create');

License

This package is licensed under the MIT License.

Copyright 2016 Sukohi Kuhoh

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固