The principles of Tonic
Tonic is designed around the idea that "less is more" and that by embracing these principles...
- Everything is a resource with a standard HTTP interface.
- Do the simplest thing that could possibly work; keep it simple, stupid.
- Modular design.
- The power of the URL-line.
- Don't forget, everything is deeply intertwingled.
...it will keep Tonic a small, easy to use, relevant, and powerful system.
Show me the money...
Often the best way to get a feel for things is to pass your eyes over an example application, so take a look at this quick example.
Features
On the face of things, Tonic looks like most other libraries for building PHP apps, but if you look a little deeper you'll notice these great RESTy features:
- Resource centric design with support for all the major HTTP methods
- Content negotiation baked in, easily deliver multiple formats of a single resource
- No sessions, no hard baked format support, less is more, none of the stuff you don't want
- HTTP Basic and Digest auth ready to go, just turn them on in your resource to protect it
- No configuration, Tonic is a library not a framework, just start using the code
- Roll your own front controller, we provide a skellington but leave you to do your own thing in your own style
The Anatomy of Tonic
Ready to get started?
- The anatomy guide to get yourself going
- Writing your first Tonic app
- The Smarty resource
- Using the SQL adapter
The Tonic cookbook
A number of common Web app tasks are obvious in Tonic once you know the ropes but getting yourself started isn't always so obvious, so we've written our experiences into the following Tonic recipe book:
- Adding a generic HTML shell to resource representations
- Set up error representations for when things go wrong
- Serving a default representation for a directory when using the file adapter
- Finding resources and using the find options
- Building a collection resource
- Setting cache control headers
- Doing HTTP redirection
- Protecting resources with HTTP Auth
API Documentation
Ready to know the code better? Then dive into our API documentation:
Created Aug 18, 2007, last modified Feb 16, 2008