No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Application
Assets
Behaviours
Builders/TreeBuilder
Components/BaseComponent
Controllers
DI
Events
Filters
Forms
Generators/UUIDGenerator
Helpers
Menu
Models
Modificators
Services
Views/Grid
Widgets
tests
.gitignore
README.md
codeception.yml
composer.json

README.md

Yii2BaseKit

Installation

Now this package in deep alpha status. And I don't recomend to use composer to install this package.

You can create directory kosuhin in your project and configure your composer.json like follow:

...
"autoload": {
    "psr-4": {
      "kosuhin\\": "kosuhin/"
    }
},
...

Services

This is a set of logic what I use in my projects on Yii2. Here is most important thing is service locator what give access to services.

To use service locator you must to configure your application like follow:

'bootstrap' => [
      ...
          [
              'class' => SLBootstarper::class,
              'locator' => SL::class
          ],
      ...
 ],

Where SL class must be your own class what extended from kosuhin\Yii2BaseKit\Services\BaseServiceLocator class.

After this configuration you will be able to use services like follow:

SL::o()->serviceName->serviceMethod();
// or from yii2
\Yii::$app->get('serviceName');

To add new service in service locator just specify new property in your SL class:

class SL extends BaseServiceLocator
{
    /** @var YourUsefullService */
    public $yourUsefullService = YourUsefullService::class;
}

Behaviours

in progress

Builders

in progress

Components

in progress

Controllers

in progress

Events

in progress

Generators

in progress

Menu

in progress

Models

in progress

Modificators

in progress

Widgets

in progress

Forms

in progress

Testing

  • To run tests:
php ../../vendor/bin/codecept run
  • To generate new unit test run command:
php ../../vendor/bin/codecept g:cest unit FirstCest
  • To generate new functional test run command:
php ../../vendor/bin/codecept g:cest functional FirstCest