Set Up Your First Website

See Download & Install for more info.

Assuming you are using Apache, your website needs three folders with the following contents:

MVC Refined

We were inspired to make MVC more suitable and intuitive for web development. We think our "Page-Model-API" architecture is pretty awesome...

Pages

Everything starts with the page. You type in a URL and your corresponding "page" is run. Pretty simple.

A page is a .php file located within the /pages folder of your codebase. When a user visits a URI of your website, a Page object is instantiated and run() which does stuff like db connections and authentication before including your .php file.

The Page object has many useful properties and methods (like templates) which automatically link up your .css and .js files. Your Page object is accessible via $this.

Also, pages never have the .php file extension in the URL thanks to our .htaccess file.

See pages for more info.

Models

Creating models is fairly simple. You choose the data fields that you want in your data object, and you have methods that validate the data fields and methods that run beforeInsert(), afterUpdate(), etc.

We have developed a clever ORM syntax called AQL (AQL Query Language) for creating multi-dimensional data objects with an "AQL statement". It's like SQL, but it can return multi-table data objects instead of a flat recordset! We use AQL to map the relational database fields to the data properties of our model.

See models for more info.

API

If your website has a database, you should have a REST API.

Send a POST or GET request like http://example.com/api/ClassName/methodName and you will get a JSON response. Most likely you will have pages that submit AJAX requests to your API. And yes, you should set permissions to limit who can do what in your class, but more on that later.

This works because there is a page that acts as the controller for your API (/pages/api.php).

See API for more info.

More Reading...

Codebases

All code is organized into reusable, cascading codebases.

Classes

There are a few classes you will want to be familiar with.

Functions

There are a few functions you will want to be familiar with.

Community

We are active on Github and welcome collaboration and code contributions!

Last edited Thu May 10 10:54:05 2012 by Stan Rozenraukh
1.153 s