sam-it/yii2-magic Improvements to Yii2 framework.

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads


Improvements for Yii2 that make it more "magic".


Use this trait in your controller to get dependency injection in controller actions. use \SamIT\Yii2\Traits\ActionInjectionTrait;


Use this trait in your form to highlight unsafe attributes. use \SamIT\Yii2\Traits\HighlightUnsafeAttributesTrait;


Use this trait in your active record model to implement single table inheritance. `` use \SamIT\Yii2\Traits\SingleTableInheritanceTrait;

protected static function inheritanceConfig() {

return [
    'map' => [
        PartnerProject::class => 'partner'
    'column' => 'type'

} ` This trait uses a different query object. If you use your own ActiveQuery implementation, use SingleTableInheritanceQueryTrait`.

0 0
1 follower
26 353 downloads
Yii Version: 2.0
License: MIT
Category: Others
Developed by: sammousa
Created on: Sep 7, 2018
Last updated: (not set)
Packagist Profile
Github Repository