Help meeee - is this feasible for codeigniter implementation |
[eluser]Subclass[/eluser]
Hi All - First Post, I've been going mental with my PHP development, and seriously feel like I need a better solution as I'm coding it new from scratch almost every time and it's draining my time and efforts. Was wondering if this kind of approach is feasible for code igniter - only slight issue is that I currently rewrite all requests through index.php allowing me to have any url for pages I'm basically splitting my application into 4x parts 1. Objects - basically properties and a constructor (no clever stuff) 2. Wiring - classes to construct objects (run db query, get data, create 'new' objects & return) 3. Templates - no php code here, just placeholders 4. Index - .htaccess rewrites all requests (except images/robots.txt/admin/etc) Problems I have (why I haven't put it into CI earlier) - have the requirement for custom urls - not /1/2/3 architecture Lack of understanding Objects -------- page.php Code: class Page Wiring ------- pages.php Code: class Pages Templates ----------- basically html files with placeholders %field1%, %field2%, <title>%seotitle</title> etc Main File (index.php) ---------------------------- Code: require(settings.php); // domain, mysql, constants etc Any feedback much appreciated ???
[eluser]Phil Sturgeon[/eluser]
Your "Objects" seem to do the job of controllers and libraries, your "Wiring" is models and your "Templates" are Views. Congratulations, you use the MVC architecture! Check out the user guide to see how CodeIgniter does this all. It will stop you re-inventing the wheel and let you spend your time using the shinier wheel that is CodeIgniter!
[eluser]Subclass[/eluser]
Thank you cookie-monster-type-thing I'll get cracking on it, just wondered if I was (and apparently I am) recreating an existing framework as have coded this from scratch over around a year.
[eluser]Phil Sturgeon[/eluser]
I'm sure it was all good practise. Any time spent doing high-level stuff like that is time well spent. I'm pretty sure my baby (PyroCMS) will be fairly useless when EE 2.0 comes out, but not going to let that stop me.
[eluser]Dam1an[/eluser]
EE2 = Expression Engine 2, it's the commercial product made by Ellis Labs |
Welcome Guest, Not a member yet? Register Sign In |