Yii 2: Using a component only in backend

226 views Asked by At

I have developed a component to crop images, and now I am migrating it to Yii 2. There are a PHP class, a JS, a CSS, and an image files.

I am in doubt whether I place these files. Is it better to create a directory at basepath/vendor, or to add in the respective directories (image, css, and js), on backend/web and reference them in backend/assets/AppAsset? Note that I will only use this component in the backoffice.

What is the conventional way to do this?

1

There are 1 answers

3
ScaisEdge On BEST ANSWER

For my experience is better build a component in vendor/yourVendorName/yourModuleName in the form of module and the you can use it where do you prefer adding to modules section of config/main.php of your app