humweb / widgets
Widgets package
Installs: 20 997
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is auto-updated.
Last update: 2024-11-29 04:14:25 UTC
README
Install
Via Composer
$ composer require humweb/widgets
Usage
Register anonymous function handler
$widgets = new WidgetFactory(); $widgets->register('foo', function($val = '') { return 'bar'.$val; }); echo $widgets->foo('baz');
Register class handler
$widgets = new WidgetFactory(); $widgets->register('foo', 'Humweb\Widgets\Tests\Fake\FooWidget@render'); // or // $widgets->register('foo', 'Humweb\Widgets\Tests\Fake\FooWidget'); // Check for registered widget $this->widgets->has('foo'); // Renders echo $this->widgets->foo();
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ryun@humboldtweb.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.