wfpl
wfpl is a well factored PHP library. It is Free Software, released into the public domain / CC0.
It's alive!
Jason Woofenden uses wfpl for work, and adds to it, and tweaks it as necessary. Sometimes it doesn't get updated much, because it already does most of what he wants it to do.
Features
wfpl has:
- a form generator (as seen here: http://jasonwoof.com/metaform/)
- a good template engine (see below).
- a very handy and secure database API
- a session tracker
- a system for displaying messages to the user (which can be saved accross http redirects if you want.)
- upload handling (including special handling for images that fixes extensions)
- a framework which makes it easy to have your php file pass the request on to another php script with or without a redirect.
- lots of little functions to do all sorts of things.
wfpl Template Engine
The wfpl template engine has the following features:
- There is no executable code in the template file.
- When you put a variable in a template, you can specify an encoding (or multiple.) For example, in an email template, you generally don't want an encoding and would just do
~varname~
, but in an html document, you might do~varname html~
or<a href="?f=~varname urlval~">
- Template sections (parts of the template that may be hidden, shown, or repeated any number of times) are denoted in a syntax that allows you to jump between the opening and closing tags easily in a text editor such as vim. Wfpl template section syntax uses
~section_name {~
to start a section and~}~
to end it. - Template sections are all ended with the same markup (
~}~
) regardless of the section name, so improper nesting is not possible. - Template sections can have an argument that affects the relationship between the (matching) data and how many times that section is displayed.
- You can easily merge two templates. This effectiveley pastes the template sections from the child template into the parent template, at the locations specified in the parent template.
Jason Woofenden built this template engine from scratch (with a little help from Josh Grams) because he couldn't find any template engines he liked. If you are aware of a template engine that has _all_ the features above, please contact Jason Woofenden and tell him all about it.
Examples
Don't want to build a site from scratch?
Here's an example of a site built with WFPL. It has an admin interface where you can edit pages, upload images, etc: https://jasonwoof.com/gitweb/?p=wfpl-cms.git
Jason Woofenden usually starts new sites by clowning that.
Dependancies
wfpl requires only PHP 5.3 or greater.
Download or browse the source
https://jasonwoof.com/gitweb/?p=wfpl.git
The "snapshot" links above download the whole project.
Or you can use git:
git clone https://jasonwoof.com/git/wfpl.git
Give feedback
Contact Jason Woofenden if you have any comments, questions, patches, recommendations, additions, etc..