diego1araujo/titleasy
Composer 安装命令:
composer require diego1araujo/titleasy
包简介
Build titles like a charm in Laravel 4/5
README 文档
README
Titleasy - Build titles like a charm.
This package is an HTML title generator for Laravel 4.
For Laravel 5, use the 1.0 branch!
Installation
Edit composer.json file to require this package.
"require": {
...
"diego1araujo/titleasy": "dev-master"
}
Next, run the composer update command:
composer update
Open up app/config/app.php
Find the providers key and add a new item to the array
'Diego1araujo\Titleasy\ServiceProvider',
Find the aliases key and add a new item to the array
'Title' => 'Diego1araujo\Titleasy\Facade',
Methods
put - add titles. return: void last - retrieve last title added. return: string get - build the title. return: string. there are 3 params: - site name - delimiter (default: -) - reverse mode (default: false)
Usage
Starting
Title::get('My Website') // Output: My Website
Adding a title
Title::put('Users Page') Title::get('My Website') // Output: My Website - Users Page
Changing the delimiter (Set a second parameter on get)
Title::put('Users Page') Title::get('My Website', '|') // Output: My Website | Users Page
Switching to reverse order (Set a third parameter on get as TRUE)
Title::put('Users Page') Title::get('My Website', '|', TRUE) // Output: Users Page | My Website
Multiple titles
Title::put('Users Page') Title::put('Editing') // or just: Title::put('Users Page', 'Editing')
Retrieving the last title added
Title::last()
Out of Laravel
Require via composer
composer require diego1araujo/titleasy
When asked for a version, choose:
dev-master
Create a index.php like:
<?php require_once 'vendor/autoload.php'; use Diego1araujo\Titleasy\Titleasy as Title; Title::put('Users Page'); echo Title::get('My Website');
NOTE: This job was based on mywizz's library. Credits goes to him, also.
统计信息
- 总下载量: 452
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2013-09-25