www.webdeveloper.com
Results 1 to 3 of 3

Thread: File and Design Structure (General)

  1. #1
    Join Date
    May 2012
    Posts
    2

    Post File and Design Structure (General)

    Hi all, this post is pretty general but I want to use PHP so that's why it is here.

    I have a thorough understanding of PHP and have been developing websites for a few years now, I want to take this one step further and start creating fully dynamic websites from scratch as they would be in industry or fully scaled projects like PHPBB or any PHP CMS system.

    At the moment I structure my sites with 1 page that contains the main template for the website, and somewhere inside that where I want the content, I would put a script like so:

    PHP Code:
    if($_GET['page']({
      include(
    './' $_GET['page'] . '.php');

    Obviously I would put in some error checking and that. Is this the most efficient way of doing it? I read through some articles but most of them said to design a template and include specific files such as sidebar.php and footer.php. The only problem I see with this, is that if I have 20 pages, and I wanted to move the sidebar.php to the bottom, I would need to move the <div> tags on all of the 20 pages.

    If you use my way, you only need to edit 1 page and the content doesn't need to be edited in turn. Any tips and pointers in the right direction?

  2. #2
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    The approach you're using is actually the same as what the major frameworks. You should stick with what you've been doing.

    If you're looking for any further design structure ideas, the article From Flat PHP to Symfony2 is a nice step by step guide.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  3. #3
    Join Date
    May 2012
    Posts
    2
    Thanks for the link Jeff! I just skim read it and that is exactly what I have been looking for. I had no idea my way of doing things was right, I just thought I was hacking code together with no real structure. Thanks once again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles