Let's go take a look at these files now. If there are any I don't cover today, we'll be going over them in a future article.
Included by fbx_Fusebox3.0_PHP4.1.x.php (see below), fbx_Circuits.php is where the circuits of our Fusebox are defined. This is the place where values are set that determine the structure of the app. A typical fbx_Circuits (and the one you downloaded) looks like this:
$Fusebox["circuits"]["home"] = "home";
Don't worry - we'll be adding circuits to this code soon enough.
fbx_Fusebox3.0_PHP4.1.x.php (or fbx_Fusebox3.0_PHP4.0.6.php)
This is the "engine" of the Fusebox application - the file that makes it all possible. It does the following things:
You'll be happy to know that this file should not be modified in any way, and can function as the heart of your web application right out of the box, so to speak. You should understand the full functionality behind this key file, but this is by no means required since editing the file's source code could make your application incompliant with the Fusebox 3 specification, defeating the whole purpose of using the methodology in the first place!
This file consists of a switch/case statement that tells the application which files to include. Here's the code you see when you open it up:
print "I received a fuseaction called <b>'" . $Fusebox["fuseaction"] . "'</b> that circuit <b>'" . $Fusebox["circuit"] . "'</b> does not have a handler for.";
Leave this file alone for now. We'll be back to it shortly.
This is where default values are set for each circuit. Circuits (subdirectories) each have their own versions of this file. If they do, the variables' values in the individual circuits' fbx_Settings.php files will overwrite their default values in the root directory's fbx_Settings.php.
index.php - or whatever your server's default document is called.
This is where we load the core file, or for lack of a better word engine, of the Fusebox architecture: fbx_Fusebox3.0_PHP4.1.x.php
This is a typical layout file, and is required in each circuit of your application. If you were making an application with many circuits, you'd want to make sure this file is placed in each circuit's directory, along with the other core files required in each circuit. In a future article we'll discuss the incredibly cool use of nested layouts,
You should have at least one fbx_layouts.php
A typical display file. This file will be included in our main circuit.
blog comments powered by Disqus