How to use Framefront.

It's very simple to get started with Framefront. There are two steps to getting started: 1) download the files, and 2) copy and paste the files to your root directory. When you are done getting everything set up all you have to do is code your template in XHTML/CSS, and then code your XHTML/CSS (or PHP) into your views.

Getting Started

To get started you will need to download the latest Framefront release. Once it's complete, extract it to the root directory where your website will be located. That's all you need, you're done getting started.

Coding Your Templates

Framefront comes packaged with 2 basic empty templates which can be found in the templates directory:

Template.php This template file normally consists of the XHTML/PHP for your interior design and encompasses your views. The only requirement is to include the following line of PHP code where you wish for your views to display within the template:

<?php echo include($content); ?>

* By default this template file is turned on to encompass the home view which can be found inside the views directory in index.php.

Home.php This template file is for the XHTML/PHP which can be found on your homepage, and is served only to your homepage when it is turned on. You do not have to worry about the special PHP line that is required by the template.php file, you code this template how you wish. By default, this template is turned off.

Turning the Home template on

Based on your coding style, you may want to turn the home.php template on and off. These three lines of code can be found at the bottom of the core code found in index.php (by default lines 54-56).

Turning Home.php off (default)

$content = 'views/' . $view . '.php';
include_once('templates/template.php');	
// include_once('templates/home.php');

Turnning Home.php on

// $content = 'views/' . $view . '.php';
// include_once('templates/template.php');	
include_once('templates/home.php');

* Instructions to turn the home.php template on and off can also be found within the core code at the bottom of the index.php file.

Coding Your Views

Before you can start coding your views, you will need to create a view file inside the views directory such as 'about.php' for example.

Once your view file is created, coding it is just as simple. All you need to do is place whatever XHTML or PHP you need inside the view files. That's all, you're done.

Linking it All Together

As simple as it is to code your templates and views, it's even more simple to tie it all together using Framefront's clean URI structure. Use the following URI structure to tie it all together:

<a href="/viewNameHere">View name here</a>

Example using the About Us view

<a href="/about">About Us</a>

The above anchor will combine an about.php view to the template.php file.

Taking your Clean URL's further

The point of using clean URL's is because yoursite.com/team/yourname looks a lot better than yoursite.com/index.php?module=team&member=yourname.

In any typical site, you are going to need more than just an /about link, you are going to need multiple level deep URL's. Let's take the following URL for example:

<a href="/team/michaeldick/">Michael Dick</a>

You're going to need access to michaeldick, but how?

I built into Framefront an alternative to $_GET[], called $get[]. You will use numbers 1,2,3,4,ect to access the depth of the url. $get[1] will ALWAYS be your view, then from there you will use $get[2], $get[3], $get[4], ect. to control things from there.

So, in our example above, team is accessed by using $get[1], and michaeldick is accessed by using $get[2].

Taking advantage of the iPhone

No doubt about it, the iPhone is powerful, and compatibility is desired! I have built into Framefront instant iPhone compatability, all you have to do is create alternative files prefixed with "i.". For example: