PHP Classes
elePHPant
Icontem

File: CHANGELOG.txt

Recommend this page to a friend!
  Classes of Rafael Rodriguez  >  Div PHP Ways  >  CHANGELOG.txt  >  Download  
File: CHANGELOG.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Div PHP Ways
Route HTTP requests to registered handlers
Author: By
Last change: get REQUEST_URI when GET var is missing
better listen properties for controllers registration
redirect method
update
Date: 1 year ago
Size: 2,457 bytes
 

Contents

Class file image Download
-------------------
Oct 18, 2017
-------------------
- Use $_SERVER['REQUEST_URI'] if any way is detected via GET vars. This
improvement allow the use of built-in PHP web server in development environment.

    index.php
    ---------
    <?php

    include "divWays.php"

    divWays::listen("/my/way", function($data, $args) {
        echo "Hello world";
    });

    divWays::bootstrap('_url'); // $_GET['_url'] is missing, then assume $_GET['_url'] = $_SERVER['REQUEST_URI']

    cli
    ----
    php -S localhost:9090

    web-browser
    -----------
    http://localhost:9090/my/way

-------------------
Oct 15, 2017
-------------------
- allow listen by method in controller registration

    Blog.php
    ---------------
    <?php

    #id = blog
    #listen = /feed
    #listen@Entry = /blog/{entry}
    #listen@Post = post://blog/post

    class Blog {

        static function Run($data = [], $args = [])
        {
            echo "This is the feed";
            return $data;
        }

        static function Entry($data = [], $args = [])
        {
            echo "This is the entry {$args['entry']}";
            return $data;
        }

        static function Post($data = [], $args = [])
        {
            echo "Posting a blog entry ...";
            return $data;
        }
    }

    bootstrap.php
    -----------
    <?php

    include "divWays.php";
    divWays::register("control/Blog.php");

-------------------
Oct 14, 2017
-------------------
- new method divWays::redirect($way)

-------------------
Oct 11, 2017
-------------------
- important bugfix when normalize the ways

-------------------
Sep 20, 2017
-------------------
- fix match method and more complexity

  // documentation/chapter-1
  divWays::listen("documentation/chapter-{id|is_int}", function($data, $args){
        echo "Chapter #{$args['id']}";
  });
- better control of the ways (executing single instance of each controller)
- improve example
- release 1.2
-------------------
Sep 18, 2017
-------------------
- better match method
- argument checker

    divWays::listen("blog/{id:is_int}", function($data, $args){
        echo "{$args['id']} is integer";
    });

- improve example
- drop the obsolete bulkRegister

-------------------
Sep 17, 2017
-------------------
- improve/fix match() method
- capture URL arguments

   divWays::listen("blog/{id}", function($data, $args){
        echo "Entry #{$args['id']}";
   });

- release 1.1 version