2017 © Pedro Peláez
 

helper activehelper

Active helper is a simple active state system for your links in laravel 4

image

digithis/activehelper

Active helper is a simple active state system for your links in laravel 4

  • Thursday, November 21, 2013
  • by digithis
  • Repository
  • 5 Watchers
  • 16 Stars
  • 1,359 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

Active Helper

active helper is a simple active state system for your links in laravel 4, (*1)

How to install

Add the following line in your composer.json, (*2)

"digithis/activehelper": "dev-master"

Then run composer update, (*3)

In app/config.app.php, add the following line to the providers array, (*4)

'Digithis\Activehelper\ActivehelperServiceProvider',

In the aliases array, add the following line, (*5)

'Active'  => 'Digithis\Activehelper\ActiveFacade',

How to use

Create a link and its current state :, (*6)

echo Active::link('users', URL::to('users'), 'Show all users');

This means that if the current request is users, class for link is .active, (*7)

Add several more routes as a first parameter :, (*8)

echo Active::link(array('users', 'user/add', 'user/edit'), URL::to('users'), 'Show all users');

Use * as a pattern or exclude routes with not: :, (*9)

echo Active::link(array('user*','not:user/edit'), URL::to('users'), 'Show all users');

This means that if the request begins with user but is not user/edit, class for link is .active, (*10)

Set your own attributes if you wish:, (*11)

echo Active::link(array('group*','not:groups*'), URL::to('group'), 'Show group', array('id' => 'mycustomid'));

You can also only get the current state (boolean), (*12)

$state = Active::is('page*','not:pages*');

And return the active class if the routes are matched, (*13)

Active::classes('page*', 'not:pages*');

// Returns 'active'

The Versions

21/11 2013

dev-master

9999999-dev http://github.com/digithis/activehelper

Active helper is a simple active state system for your links in laravel 4

  Sources   Download

MIT

The Requires

 

by Avatar digithis

laravel laravel 4 active links