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 those who do not have time

  1. Get the file
  2. Put them in you Document root
  3. Create an 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