Sha256: beb1ac78f1e89c98da3745527212a00a58d1fc77487bc19ac016ea62c7e03ad3

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

# Trivial - the ultra-lightweight Web framework for PHP

## Installation

Installation is done via RubyGems:

`gem install trivial`

A new binary is created, `trivialize`.

## Creating a new site

`cd` to the directory where you want your new site and type:

`trivialize my-new-site`

A directory called `my-new-site` will be created with the site structure in place. An example `content/index.html` and `views/application.inc` will also be installed.

## The request process

When a request comes in to that directory for a file that doesn't exist, trivial
does the following (for the examples, the request was for `about_us/contact.html` and the default `$layout` value is `"application"`):

* The `content` folder is checked for a `.html` file that matches the path (`content/about_us/contact.html`). If it exists, the contents of the file are pulled into the global `$content` variable.
* The `actions` folder is checked for two files:
	* `actions/application.inc`
	* `actions/about_us/contact.inc`
	Each found file is included into the program, potentially modifying `$content` or `$layout`.
* The `views` folder is checked for two files:
	* `views/about_us/contact.inc`
	* `views/application.inc`
	Each found file is included into the program, including `$content` where specified and outputting back into `$content`.
* The value of `$content` is output to the visitor.

## Styles and scripts

Styles and scripts can be searched for in a structured way. The included `views/application.inc` gives an example as to how this works.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trivial-0.0.5 readme.md
trivial-0.0.4 readme.md
trivial-0.0.3 readme.md