SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2007
    Posts
    398
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Templates in php

    One thing I've never undestood in templates it how people use them in php. For example if I create a:

    - match reports page id call it reports.php

    and if I created a news page i'd call it:

    - news.php

    But I see some websites just have one template page ie: page.php an then use it to call out the section they want ie:

    page.php?section=news
    or
    page.php?section=reports

    Then depending on what's called out the way the information is called out is changed in the way the page is laid out. An example being:

    http://www.greenocktelegraph.co.uk/w....php?sec=terms
    and
    http://www.greenocktelegraph.co.uk/w...t&id=editorial

    Can anyone please explain and possibly post links to any tutorials

    Thanks

    Chris

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    A couple of links have been posted here:
    http://www.sitepoint.com/forums/showthread.php?t=484031

    kyberfabrikken Posted a real good one there too.
    http://www.sitepoint.com/forums/show...06&postcount=5
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,000
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What I presume is that the provided website works on includes bases.

    It would check value of section var provided through GET, and include corresponding "template" or php page to show.

    Purpose of templating is separating php code and presentation.

    I would suggest you to search this forum a little bit about it, I'm sure it was discussed many times before.
    -- Jelena --

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2007
    Posts
    398
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks guys


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •