Skip to content
jetviper21 edited this page Sep 13, 2010 · 20 revisions
require 'nimble.php';
R('')->controller('test')->action('index')->on('GET');
class Test extends C{
    public function index(){
        echo 'Hello';
    }
}
run();

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('nimble.php');
5. Make urls like this, define the url, class, method and HTTP method:

More on Routing


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’);

5a. for helpers to use in your application to call these routes see UrlBuilders and Helpers

6. Write a class that extends C or Controller
More on Controller

class Test extends C{}
class Test extends Controller{}

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