TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   One index.php (http://www.talkphp.com/absolute-beginners/3226-one-index-php.html)

Aaron 08-09-2008 06:34 PM

One index.php
 
I am horrible with using one index.php file, and a lot of $_GET[] and mod_rewrite...

how do I get outta this habit? :3
what doesn't belong in the main page?

Kalle 08-09-2008 06:47 PM

what doesn't belong in the main page?
All content thats not always on the main page which can be done by includes =)

CoryMathews 08-10-2008 03:54 AM

Quote:

Originally Posted by Aaron (Post 17677)
I am horrible with using one index.php file, and a lot of $_GET[] and mod_rewrite...

how do I get outta this habit? :3
what doesn't belong in the main page?

Wait why the hell would you want to do that? whats the benefits?

Aaron 08-10-2008 11:07 AM

I don't want to, that's why I posted this :P.
The template class (smarty), a database, and an Index.php file just make EVERYTHING work :/

delayedinsanity 08-10-2008 05:54 PM

It really shouldn't be that hard to wean yourself of this.

Write up, or draw up a site map. Then make your pages.

Index... contact... about...

Aaron 08-11-2008 03:59 AM

$_GET['about'], $_GET['contact'] @import contact.php

delayedinsanity 08-11-2008 05:01 AM

or...

/contact.php

Folio 08-12-2008 01:51 PM

you should look into bootstrapping with the MVC pattern.
all traffic is redirected to index.php and depending upon the appended string depends on what is loaded.

Aaron 08-12-2008 04:37 PM

I despise the Singleton and MVC patterns.

Anyway, I have ported most of my code out to include files. It feels weird.


All times are GMT. The time now is 10:35 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0