2017 © Pedro Peláez
 

library widgets

Widgets back to basic, with Laravel support.

image

displore/widgets

Widgets back to basic, with Laravel support.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Displore Widgets

Latest Version on Packagist ![Quality Score][ico-code-quality], (*1)

Widgets back to basic, with Laravel support., (*2)

Install

Via Displore Core

``` bash $ php artisan displore:install widgets, (*3)

This does everything for you, from the Composer requirement to the addition of Laravel service providers.

### Via Composer

``` bash
$ composer require displore/widgets

This requires the addition of the Widgets service provider and Widgets facade alias to config/app.php if you use the package with Laravel. Displore\Widgets\WidgetsServiceProvider::class, and Displore\Widgets\Facades\Widget::class,, (*4)

Configuration

In the configuration file you can set up dynamic resolving or register the widgets in a similar fashion to how config/app.php works with aliases., (*5)

$ php artisan vendor:publish --tag=displore.widgets.config

Usage

The package does not rely on Laravel, as shows the following example. ``` php $arrayOfProviders = [ 'headline' => My\Widgets\Headline::class, ]; $service = new WidgetsProvider($arrayOfProviders); $widget = $service->get('headline'); // Calls getWidget() on the Headline class., (*6)


With Laravel, the array of providers is found in a dedicated configuration file. In your views you can call the `Widget` facade to get widgets. It is also possible, either with or without Laravel, to use a dynamic widgets provider, meaning that on every request, all classes in a given path will be searched for the widget needed. Especially useful during development. For Laravel, set `dynamic` to true in the configuration file. For non-laravel: ```php $service = (new DynamicWidgetsProvider) ->withPath('Path/To/Widgets/Classes') ->withNamespace('My\\Widgets') ->scanForProviders(); $widget = $service->get('headline');

You can also set widgets during runtime, with both the static and dynamic widgets provider:, (*7)

// Laravel facade
Widget::set('headline', new My\Widgets\Headline::class);

// Self instantiated service
$service->set('headline', new My\Widgets\Headline::class);

Change log

Please see changelog for more information what has changed recently., (*8)

Testing

The package comes with unit tests. In a Laravel application, with Laravel Packager: bash $ php artisan packager:git *Displore Github url* $ php artisan packager:tests Displore Widgets $ phpunit, (*9)

Contributing

Please see contributing for details., (*10)

Credits

License

The EUPL License. Please see the License File for more information., (*11)

The Versions

27/06 2016

dev-master

9999999-dev https://github.com/Displore/Widgets

Widgets back to basic, with Laravel support.

  Sources   Download

EUPL-1.1

The Requires

  • php ~5.5|~5.6|~7.0

 

The Development Requires

laravel widgets displore

25/06 2016

v1.0

1.0.0.0 https://github.com/Displore/Widgets

Widgets back to basic, with Laravel support.

  Sources   Download

EUPL-1.1

The Requires

  • php ~5.5|~5.6|~7.0

 

The Development Requires

laravel widgets displore