kade119 Posted April 8, 2010 Share Posted April 8, 2010 Let's say i have a basic web site with snippets of PHP throughout all of it do most of you put all of your site's page files on the root? and then make a PHP folder and a JS folder? I know I should have a file for my PHP functions what's a good way to structure the site? say this is my header and is an include - how do most of you link your css, javascript, php, xml files? do you make a config file? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" media="all" type="text/css" href="base.css" /> <link type="text/css" href="jquery.ui.all.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="jqtransformplugin/jqtransform.css" /> <link rel="stylesheet" type="text/css" href="formValidator/validationEngine.jquery.css" /> <link type="text/css" href="colorbox.css" rel="stylesheet" /> <title>Site Title</title> <script type="text/javascript" src="js/jquery-1.4.2.js"></script> <script type="text/javascript" src="js/jquery.ui.core.js"></script> <script type="text/javascript" src="js/jquery.ui.widget.js"></script> <script type="text/javascript" src="js/jquery.ui.accordion.js"></script> <script type="text/javascript" src="jqtransformplugin/jquery.jqtransform.js"></script> <script type="text/javascript" src="formValidator/jquery.validationEngine.js"></script> <script type="text/javascript" src="script.js"></script> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="js/jquery.colorbox-min.js"></script> <script type="text/javascript" src="js/jquer Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/ Share on other sites More sharing options...
kade119 Posted April 8, 2010 Author Share Posted April 8, 2010 my index file usually looks something like this... <?php include('includes/header.php'); ?> <?php include('includes/menu.php'); ?> <div id="content"></div> <?php include('includes/leftcolumn.php'); ?> <?php include('includes/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038961 Share on other sites More sharing options...
Mchl Posted April 8, 2010 Share Posted April 8, 2010 It depends a lot on how you organise your code. Take a look for example on how Zend Framework applications are usually organised on disk http://framework.zend.com/manual/en/learning.quickstart.create-project.html Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038966 Share on other sites More sharing options...
kade119 Posted April 8, 2010 Author Share Posted April 8, 2010 this might sound dumb... but what all does Zend do, do most php programmers use zend on their projects? Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038969 Share on other sites More sharing options...
Mchl Posted April 8, 2010 Share Posted April 8, 2010 Zend is a company developing PHP, so one could say all PHP programmers use Zend... Zend Framework on the other hand, is a set of PHP Classes that implement many common tasks, making working on large projects easier. It's possibly most widely used PHP framework (there are others), but I don't think that most PHP programmers use it. My point when posting this link was, you can keep it simple, or you can create an extensive directory structure. There is no one golden rule. Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038972 Share on other sites More sharing options...
kade119 Posted April 8, 2010 Author Share Posted April 8, 2010 well thanks for not thrashing me - being a beginner, just learning PHP - would you recommend learning using Zend? Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038974 Share on other sites More sharing options...
kade119 Posted April 8, 2010 Author Share Posted April 8, 2010 to use Zend, do I need to modify my .ini file? Do you use Zend server instead of Apache or do you use the 2 together? Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038977 Share on other sites More sharing options...
Mchl Posted April 8, 2010 Share Posted April 8, 2010 I think you should first get familiar with PHP itself. Frameworks in general and Zend Framework in particular have pretty steep learning curve, and you do not really need them for small to medium projects. In most cases you don't need to do any changes to php.ini file, but be sure to check this list of requirements: http://framework.zend.com/manual/en/requirements.introduction.html Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038983 Share on other sites More sharing options...
kade119 Posted April 8, 2010 Author Share Posted April 8, 2010 yea i found this tutorial http://usingzendframework.blogspot.com/2007/01/setting-up-zend-framework.html Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038985 Share on other sites More sharing options...
Mchl Posted April 8, 2010 Share Posted April 8, 2010 If you really want to try it, I'd recommend a QuickStart tutorial from Zend Framework site. Many things changed since 2007. Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1038990 Share on other sites More sharing options...
kade119 Posted April 8, 2010 Author Share Posted April 8, 2010 No - i think your correct, i need to continue with small PHP scripts, it's just good for me to know about things like this ahead of time so when I am ready.. so any other resources like Zend - please tell me Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/197996-structuring-filesfolders-for-a-php-web-site/#findComment-1039000 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.