Reputation: 630
I am new to yii and using version 2. I developed a project which uses a library (I coded) for parsing a CAD model file, extract vertexes, edges, faces etc, finally combine those entities to display the model and then extract features. It displays the model using the three.js library. A user has to be signed-in in order to upload the model file and do all this stuff. I would like to refactor the app into version 2 using the yii 2 framework. So I would like to know how I can merge the feature recognition library into the yii app, should I create a Components, Extension or Module or use other means?
The library is coded in plain OOP. I access it by requiring an init.php
file which requires about 20 library class files. If I create a module for the library the view will draw the model but where do the parser and feature extractor go in the model or controller files?
Thanks in advance.
Upvotes: 3
Views: 376
Reputation: 18021
In Yii 2 basically everything is a component.
Extension is the term usually used for the vendored components (or modules) available at packagist.org (or similar) so if you are not planning to release it outside you don't have to worry about extension-ing it.
Now for the component-module debate - module is a component that allows you to use it's own controllers structure so if you need something like this - use module. In any other case simple component is just fine.
Upvotes: 3