• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Developing without MVC?

#1
[eluser]cmac[/eluser]
One of the things that Zend and some other frameworks have is the possiblilty of using the loosely coupled parts of the framework. In Zend you only have to include a class to be able to use its methods.

Can you do this with CI? I have looked for any clues to doing this on the forum and have found nothing. What I am looking for is something similar to how you can load the entire Wordpress environment into an external application by just calling the header file.

Including the CI index file does not work because it causes the auto loading of the MVC and router.

I do not want to use MVC for every application but would like to use a single framework for the sake of consistency.

#2
[eluser]TheFuzzy0ne[/eluser]
Essentially, all you need are the libraries. You'd need to create a loader for loading them, and ensure that any dependencies are met. This can include helpers (show_error()), and some functionality from the base core files, which you will need for some libraries. CodeIgniter has been built with MVC in mind, using it for something other than MVC would be like using a salmon for a baseball bat, it's just not how it's intended to be used.

#3
[eluser]Yorick Peterse[/eluser]
If you want something that's a bit like CodeIgniter, but withouth the MVC structure, try Flourish : http://flourishlib.com/

#4
[eluser]xwero[/eluser]
MVC has nothing to do with the running CI side by side or inside another application, this is the job of the frontcontroller (system/codeingniter/CodeIgniter.php).

I'm not sure why you would want to run a CI page in a page from an external application as CI doesn't display anything out of the box. For WP or a forum you already have prebuild output files, the software package makes it faster for you to add sections to your website.

Can you tell how you want to use CI in external applications?

#5
[eluser]cmac[/eluser]
[quote author="xwero" date="1243451679"]

Can you tell how you want to use CI in external applications?[/quote]

Besides the new I have several applications that need to be extended or partially refactored. But they are a part of a group (not written by the same developer)that is already under URI control and some of them would not work as well under MVC ( one uses the factory model). None of the code at the moment looks similar. I though I would avoid having to learn each each one and give some commonality to them all. Like forms, XML feeds and adding lists and any small pieces would be done in Codeigniter so later updates would be easier.

Flourish looks like what I need but I like Codeigniter and its syntax.

#6
[eluser]Yorick Peterse[/eluser]
[quote author="cmac" date="1243464609"][quote author="xwero" date="1243451679"]

Can you tell how you want to use CI in external applications?[/quote]

Besides the new I have several applications that need to be extended or partially refactored. But they are a part of a group (not written by the same developer)that is already under URI control and some of them would not work as well under MVC ( one uses the factory model). None of the code at the moment looks similar. I though I would avoid having to learn each each one and give some commonality to them all. Like forms, XML feeds and adding lists and any small pieces would be done in Codeigniter so later updates would be easier.

Flourish looks like what I need but I like Codeigniter and its syntax.[/quote]

Then I guess it's best if you make your own framework. It's not hard to do, in fact, it's easier than you might think.

#7
[eluser]cmac[/eluser]
I found this and so will give it a try.

http://codeigniter.com/wiki/dip_into_CI/


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.