This plugin provides the necessary elements for using Swivel in a Yii 2.0+ Application.
This plugin is based on the zumba/swivel-cake plugin.
'swivel' => [
'class'=>'dhluther\swivel\SwivelComponent'
],
// If the user has the feature behavior bucket enabled, use the testFeature.New.Something behavior,
// else use the default
Yii::$app->swivel->forFeature( 'testFeature' )
->addBehavior('New.Something', [$this,'doSomethingB'], $args)
->defaultBehavior([$this, 'doSomethingA'], $args )
->execute();
// If the user has the feature behavior bucket enabled, use the first callable,
// else use the second callable (default)
Yii::$app->swivel->invoke('testFeature.New.Something', [$this,'doSomethingB'],[$this, 'doSomethingA']);
Make sure that your bootstrap file is set to properly include the composer autoloader.
In the index.php bootstrap:
require(__DIR__ . '/../vendor/autoload.php');
'migrationNamespaces'=>[
'dhluther\\swivel\\migrations'
]
with the alias of:
'@dhluther\swivel'=>'@vendor/dhluther/yii2-swivel/src'
If you've already migrated this package in the past and want to mark it to the current migratoin via namespace, the command is
./yii migrate/mark dhluther\\swivel\\migrations\\m190812_083802
docker run --rm -v $PWD:/app composer update
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
SwivelComponent::initSwivelTable
method and associated SwivelComponent::$autoCreateSwivelTable
property. This functionality is used by the legacy method for creating the swivel table and should no longer be used.
Comments