Results 1 to 3 of 3

Thread: phpBB coding style... oop?

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  3. #3

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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
  •  



Click Here to Expand Forum to Full Width