2017 © Pedro Peláez
 

library titleasy

Build titles like a charm in Laravel 5

image

diego1araujo/titleasy

Build titles like a charm in Laravel 5

  • Tuesday, July 25, 2017
  • by diego1araujo
  • Repository
  • 2 Watchers
  • 5 Stars
  • 443 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Titleasy - Build titles like a charm.

This package is an HTML title generator for Laravel 4., (*2)

For Laravel 5, use the 1.0 branch!

Installation

Edit composer.json file to require this package., (*3)

"require": {
    ...
    "diego1araujo/titleasy": "dev-master"
}

Next, run the composer update command:, (*4)

composer update

Open up app/config/app.php, (*5)

Find the providers key and add a new item to the array, (*6)

'Diego1araujo\Titleasy\ServiceProvider',

Find the aliases key and add a new item to the array, (*7)

'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, (*8)

Title::get('My Website') // Output: My Website

Adding a title, (*9)

Title::put('Users Page')
Title::get('My Website') // Output: My Website - Users Page

Changing the delimiter (Set a second parameter on get), (*10)

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), (*11)

Title::put('Users Page')
Title::get('My Website', '|', TRUE) // Output: Users Page | My Website

Multiple titles, (*12)

Title::put('Users Page')
Title::put('Editing')
// or just:
Title::put('Users Page', 'Editing')

Retrieving the last title added, (*13)

Title::last()

Out of Laravel

Require via composer, (*14)

composer require diego1araujo/titleasy

When asked for a version, choose:, (*15)

dev-master

Create a index.php like:, (*16)

<?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., (*17)

The Versions

25/07 2017

1.0.x-dev

1.0.9999999.9999999-dev

Build titles like a charm in Laravel 5

  Sources   Download

BSD-2-Clause

The Requires

 

by Diego Araujo

laravel title

11/10 2015

dev-master

9999999-dev

Build titles like a charm in Laravel 4/5

  Sources   Download

BSD-2-Clause

The Requires

 

by Diego Araujo

laravel title

02/08 2015

v1.0.0

1.0.0.0

Build titles like a charm in Laravel 5

  Sources   Download

BSD-2-Clause

The Requires

 

by Diego Araujo

laravel title