Jump to content

Structuring files/folders for a PHP web site?


kade119

Recommended Posts

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

Zend is a company developing PHP, so one could say all PHP programmers use Zend... :P

 

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.