2017 © Pedro Peláez
 

yii2-extension yii2-react

ReactJS Asset Bundle for Yii2

image

mimicreative/yii2-react

ReactJS Asset Bundle for Yii2

  • Tuesday, October 18, 2016
  • by haqqi
  • Repository
  • 4 Watchers
  • 11 Stars
  • 266 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

React.js Asset Bundle for Yii2

Installation

The preferred way to install this extension is through composer., (*1)

Add to the require section of your composer.json file:, (*2)

"mimicreative/yii2-react": "~1.0"

And run in terminal, (*3)

composer update

Usage

Use as the asset bundle in Yii2 View files., (*4)

// use this if you do not need addons
\mimicreative\react\ReactAsset::register($this);

// use this if you need addons
\mimicreative\react\ReactWithAddonsAsset::register($this);

By default, this extension use the minified version. I also include the react-dom.min.js because we usually need it to render in js files. To customize what asset to use, you can set the configuration in the Yii2 config files. Please refer to React Bower package for the list of the files., (*5)

For example if you want to use non-minified version:, (*6)

// in main.php config file

return [
  'components' => [
    'assetManager' => [
      'bundles' => [
        'mimicreative\react\ReactAsset' => [
          'js' => [
            'react.js',
            'react-dom.js'
          ]
        ],
        'mimicreative\react\ReactWithAddonsAsset' => [
          'js' => [
            'react-with-addons.js',
            'react-dom.js'
          ]
        ]
      ]
    ]
  ]
];

Further Information

Please, check the React.js site documentation for further information about its configuration options., (*7)

The Versions

18/10 2016

dev-master

9999999-dev

ReactJS Asset Bundle for Yii2

  Sources   Download

MIT License

The Requires

 

yii2 react

18/10 2016

1.0.2

1.0.2.0

ReactJS Asset Bundle for Yii2

  Sources   Download

MIT License

The Requires

 

yii2 react

19/07 2016

1.0.1

1.0.1.0

ReactJS Asset Bundle for Yii2

  Sources   Download

MIT License

The Requires

 

yii2 react

16/06 2016

1.0.0

1.0.0.0

ReactJS Asset Bundle for Yii2

  Sources   Download

MIT License

The Requires

 

yii2 react