View Poll Results: How do you separate the 2 Cs (Content and Code)?

Voters
6. You may not vote on this poll
  • I don't separate them, they are both in the same file (close tag, output content, open tag).

    0 0%
  • I generate my content in the same file, but entirely with code (the print function, or echo).

    2 33.33%
  • I separate the content from the code, and I load templates on which I apply content.

    3 50.00%
  • What are you talking about?

    1 16.67%
+ Reply to Thread
Results 1 to 2 of 2

Thread: Separating Code from Content

  1. #1
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,436

    Separating Code from Content

    I've seen some tutorials, some programs, etc. that mix up content (html in this case) and code (php here). For instance, they would start an IF clause, close the php tags, put in some html, reopen the php tags and close the IF block.
    I find this practice bad, because the code and the content are embedded into each other. Here is my call:

    If you want to generate all the html from server-side code, output it normally, but if you want to separate the code, the content (, etc.), then use a templating system, or create one.

    What's your call.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  2. #2
    ichwar's Avatar
    ichwar is offline Community Advocate ichwar is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    NC, USA
    Posts
    1,454

    Re: Separating Code from Content

    If I understand what you are asking, I have my content and code on different pages and then use more code, primarily php includes and the like, to combine them in certain orders to make my different pages.

    Is that what you are asking, or am I missing something?

+ Reply to Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. a content code needs manipulating
    By bunglebrown in forum Programming Help
    Replies: 2
    Last Post: 08-31-2008, 03:15 PM
  3. BB Code Guide
    By Jober68 in forum Tutorials
    Replies: 1
    Last Post: 01-10-2008, 05:12 PM
  4. Urgent help please!
    By retro-bliss in forum Free Hosting
    Replies: 2
    Last Post: 10-25-2007, 03:24 PM
  5. New x10 ad code
    By yahia in forum Feedback and Suggestions
    Replies: 23
    Last Post: 01-02-2007, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers