Funky ways to build a page in php?

Discussion in 'PHP' started by static1635, Jul 8, 2012.

  1. #1
    Hi all

    I currently use includes to build my pages, calling in header, footer, and a few bits like stats etc.

    At the moment I mostly just have a bunch of includes to build the page and the content is between all this.

    Is there a more funky time saving way of doing it these days?

    Thanks

    Justin
     
    Solved! View solution.
    static1635, Jul 8, 2012 IP
  2. #2
    The modern way is to use a Framework with MVC architecture (Model, View, Controller) to separate Presentation from Business Logic... If you don't wish to use an MVC Framework your best bet is to STILL separate presentation from logic and implement object oriented classes to keep things nice and neat.
     
    NetStar, Jul 8, 2012 IP
  3. ShrinkCSS

    ShrinkCSS Peon

    Messages:
    114
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    NetStar is right, that's the standard, but it is usually overkill unless you're sculpting a really complex site... Procedural, top-down code is fine for most projects.
     
    ShrinkCSS, Jul 8, 2012 IP
  4. static1635

    static1635 Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #4
    Yes, I think keeping it simple is best :)
     
    static1635, Jul 11, 2012 IP
  5. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #5
    ShrinkCSS - it all depends on the client/owner of the site. If the user wants to be able to update the site whenever they want then you will save everyone time by using a CMS like WordPress, Drupal or Joomla to build the site. Its not "sculpting" but giving the client functionality that these days is considered to be "standard".
     
    sarahk, Jul 23, 2012 IP
  6. ibnatu

    ibnatu Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i use mvc frameworks. theres nothing wrong making a template file, then pulling view files through the template file.
     
    ibnatu, Aug 14, 2012 IP
  7. Soulstone

    Soulstone Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    It really depends of what you're trying to achieve, as said earlier.
    A lot of the popular CMSs tend to use Model-View-Controller, so I'd recommend getting to know about the MVC pattern; it doesn't have to be by using one of the large frameworks or CMSs. Just read something about how it works, what it's good for etc. Also, generally Design Patterns is a good thing to know about, since they can help you structure your code in a good way.
    Design Patterns and MVC isnt a solution to all problems though. Sometimes the "simple" way is the best way.
     
    Soulstone, Aug 14, 2012 IP