Skip to content
jetviper21 edited this page Sep 13, 2010 · 20 revisions

Nice Dog

Nice Dog is a nano web framework for PHP, like web.py for Python, Sinatra or Camping for Ruby
Minimal

require ‘NiceDog.php’;
R(‘’)→controller(’test’)→action(‘index’)→on(‘GET’);
class Test extends C{
public function index(){
echo ‘Hello’;
}
}
run();

But Why?

If you want to build a small site or software and do not need a BIG framework with a lot of features, you can use Nice
Dog. Nice Dog do not have any ORM or big features like Cake, Rails or Django have, but it is smaller, easier and faster!

Easy to deploy

Just drop the files into a folder in your Apache server!
Nice Urls

R(‘’)→controller(’test’)→action(‘index’)→on(‘GET’);

Tutorial for who doesn’t have time

1. Get the files 2. Put in your directory, like /var/www/htdocs/, no yaml, xml, *ml 3. Create a index.php 4. Just require(‘NiceDog.php’) 5. Make urls like this, define the url, class, method and HTTP method: R(‘tag/(?P[-\w]+)’)→controller(‘Test’)→action(‘p_tag’)→on(‘GET’); Ruby on Rails-style route patterns work too, with a default pattern of [a-zA-Z0-9_-]+: R(‘tag/:tag’)→controller(‘Test’)→action(‘p_tag’)→on(‘GET’); 6. Write a class that extends C or Controller class Test extends C{} 7. Write a method p_tag public function p_tag($tag){ echo $tag; } 8. And run() 9. Open in your browser: http://localhost/tag/dog
Clone this wiki locally