CodeIgniter Forums
Codeigniter the best and easy to use php framework I have ever seen - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Codeigniter the best and easy to use php framework I have ever seen (/showthread.php?tid=18597)

Pages: 1 2


Codeigniter the best and easy to use php framework I have ever seen - El Forum - 05-12-2009

[eluser]NachoF[/eluser]
I dont even understand how anyone could use MVC without using a framework....


Codeigniter the best and easy to use php framework I have ever seen - El Forum - 05-12-2009

[eluser]xwero[/eluser]
Code:
// index.php
define('PUBLIC_DIR',dirname(__FILE__).'/');
define('CONTROLLER_DIR',PUBLIC_DIR.'controllers/');
define('VIEWS_DIR',PUBLIC_DIR.'views/');

if(file_exists(CONTROLLER_DIR.$_SERVER['PATH_INFO'].'.php'))
{
   include(CONTROLLER_DIR.$_SERVER['PATH_INFO'].'.php');
}

if(file_exists(VIEWS_DIR.$_SERVER['PATH_INFO'].'.php'))
{
   include(VIEWS_DIR.$_SERVER['PATH_INFO'].'.php');
}
Models are a segmentation that isn't essential to build a page. In many framework it's 'hidden' inside the controllers.


Codeigniter the best and easy to use php framework I have ever seen - El Forum - 05-12-2009

[eluser]Cro_Crx[/eluser]
[quote author="NachoF" date="1242154262"]I dont even understand how anyone could use MVC without using a framework....[/quote]

Well you could mock up some quick php files with includes to sort that out for you with only a few lines of code, but then i guess your technically creating a framework (although a very simple one).