2017 © Pedro Peláez
 

library blade-directives

Saritasa custom blade directives

image

saritasa/blade-directives

Saritasa custom blade directives

  • Monday, March 12, 2018
  • by saritasa
  • Repository
  • 7 Watchers
  • 3 Stars
  • 1,734 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 17 % Grown

The README.md

PHP Blade Directives

PHP CodeSniffer Release PHPv Downloads, (*1)

Custom Blade directives for Laravel Applications., (*2)

See https://laravel.com/docs/blade, (*3)

Laravel 5.x

Install the saritasa/blade-directives package:, (*4)

$ composer require saritasa/blade-directives

If you use Laravel 5.4 or less, or 5.5+ with package discovery disabled, add the BladeDirectivesServiceProvider service provider config/app.php:, (*5)

'providers' => array(
    // ...
    Saritasa\Laravel\BladeDirectivesServiceProvider::class,
)

Available directives

@activeIfRoute(routeName)

Output word 'active' if URL, requested by user, matches provided route name, (*6)

Example:, (*7)

<li class="@activeIfRoute('user.settings')">
    <a href="{{ route('user.settings') }}">Settings</a>
</li>

@selectedIf(expression)

Output word 'selected' if passed expression evaluates to true, (*8)

Example:, (*9)

<select>
    @foreach($users as $user)
        <option value='{{ $user->id }}' @selectedIf($user->id == $currentUserId)>{{ $user->name }}</option>
    @endforeach
</select>

Contributing

  1. Create fork, checkout it
  2. Develop locally as usual. Code must follow PSR-1, PSR-2 - run PHP_CodeSniffer to ensure, that code follows style guides
  3. Update README.md to describe new or changed functionality
  4. Add changes description to CHANGES.md file. Use Semantic Versioning convention to determine next version number.
  5. When ready, create pull request

Make shortcuts

If you have GNU Make installed, you can use following shortcuts:, (*10)

  • make cs (instead of php vendor/bin/phpcs) - run static code analysis with PHP_CodeSniffer to check code style
  • make csfix (instead of php vendor/bin/phpcbf) - fix code style violations with PHP_CodeSniffer automatically, where possible (ex. PSR-2 code formatting violations)
  • make install - instead of composer install
  • make all or just make without parameters - invokes described above install, cs tasks sequentially - project will be assembled and checked with linter with one single command

Resources

The Versions

12/03 2018

dev-master

9999999-dev

Saritasa custom blade directives

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sergey Populov

laravel blade

17/01 2018

1.0.4

1.0.4.0

Saritasa custom blade directives

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sergey Populov

laravel blade

17/01 2018

1.0.3

1.0.3.0

Saritasa custom blade directives

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sergey Populov

laravel blade

08/06 2017

1.0.2

1.0.2.0

Saritasa custom blade directives

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sergey Populov

laravel blade

07/04 2017

1.0.1

1.0.1.0

Saritasa custom blade directives

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sergey Populov

laravel blade

28/03 2017

1.0.0

1.0.0.0

Saritasa custom blade directives

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sergey Populov

laravel blade