|
-
Oct 12th, 2007, 04:53 PM
#1
Thread Starter
WiggleWiggle
phpBB coding style... oop?
The way i normally do php is, i have my basic HTML page, then i add php to it.
I want to make it more efficient, and have pages with just php, and include the template the way phpbb does.
but i am not sure how it works. help please?
My usual boring signature: Something
-
Oct 13th, 2007, 06:54 AM
#2
Re: phpBB coding style... oop?
There are lots of ways:
At the simplest level, you could simply put your mixed HTML and PHP into a template file and include that from your PHP-only processing file.
At a complex level, you could have a template file written in some kind of template processing language (either PHP itself, or an XML-based language) which is then processed by a template object which is instantiated and called from your processing file.
Don't go nuts trying to make everything into classes. PHP is a scripting language with some object-oriented capabilities; it's not an object-oriented platform. Generally, the fewer things you need to include for a single request, the better.
Of course, some types of request are performance-intensive, and some are not. You need to decide for yourself which pages are most likely to be hit often and streamline the design of those.
-
Oct 13th, 2007, 02:08 PM
#3
Thread Starter
WiggleWiggle
Re: phpBB coding style... oop?
ok cool thanks.
I will look into this later then, when i have more advanced pages. 
thanks
My usual boring signature: Something
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|