Ultra-lightweight website framework for PHP
Go to file
2010-04-02 10:40:13 -04:00
bin update to 0.0.4 2010-03-21 20:16:17 -04:00
config more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00
content more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00
dist update to 0.0.4 2010-03-21 20:16:17 -04:00
lib more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00
styles more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00
views more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00
Manifest more changes 2010-03-21 15:10:08 -04:00
Rakefile more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00
readme.md more work, about to mess w/ blueprint 2010-04-02 10:40:13 -04:00

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.

Notes

Trivial includes the reset.css and typography.css files from the Blueprint CSS Framework. They're automatically included in the default application.css file.