How would you go about porting a project built in CI to EE? What’s the best approach to reusing all my current CI code?
For example I have a Buy & Sell part of my website built in CI. It’s one controller with its models and views.
How do I make it viewable inside EE?
In EE there are templates for header and footer and then content in between. The usual.
But since the root of the site is controlled by EE, how would I include my Buy & Sell controller so it displays using EE’s header and footer?
Possible URL:s /buysell/new or /buysell/reciept or the root /buysell that displays the latest.
My thoughts would be to repackage it as an EE module.
The EE module system uses an MVC structure and you have access to CI through the EE global object so (hopefully) there shouldn’t be too many changes required. Anything sub-classed by EE might need to be modified however.
Exactly like that, no. EE doesn’t provide any direct file system access or processing like that.
To extend EE you need to tell it to load your additional code, which is done through the Control Panel interface rather than configuration files.
The additional code therefore needs to be packaged as an EE add-on, in the case of an MVC application, a module.
That conclusion means that I cant build the functionalities i would like and used to do in CI.
Isnt this a huge blow for EE not to be able to have true CI MVC “apps”? I mean being stuck to one URL and stick plugin code for each url template. That really hinder you to develope the flow that you can with CI and MVC.
Do I have to rid EE and use a simple template system instead?
I am by no means an expert (hopefully they’ll be back from EECI soon!), but I believe that EE is more or less designed to be a complete system, with minor functionality attached. It is a whole CI app in itself after all.
Unfortunately I know little enough about CI development or the deep dark corners of EE to know exactly what can and can’t be done. Maybe it is possible to run multiple CI apps in parallel interfacing with each other, I don’t know, sorry.
Well you should allways rewrite your code. Code is like evolution adapt or die, ask Robert C. Martin. Old code sooner or later begins to smell, after that it rots and then it dies. This has happend over and over again. Comapanys has gone out of business because of it. Treat your code as a friendship if you dont put some care into it, it will fail.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.