ITeye博客

刚刚建的仅2k的可配置的PHP URL 路由 http://code.google.com/p/qserouter/

vb2005xu · 2012-06-05 12:12 · iwp framework · 编程语言 · PHP · Web · pathinfo · router · Markdown

地址: http://code.google.com/p/qserouter/ 上午刚刚建的 :-)


<?php
require 'router.php';

function dump($vars, $label = '', $return = false)
{
    if (ini_get('html_errors')) {
        $content = "<pre>\n";
        if ($label != '') {
            $content .= "<strong>{$label} :</strong>\n";
        }
        $content .= htmlspecialchars(print_r($vars, true));
        $content .= "\n</pre>\n";
    } else {
        $content = $label . " :\n" . print_r($vars, true);
    }
    if ($return) { return $content; }
    echo $content;
    return null;
}

$routes = new Router(require('mapping.php'));

$testarr = array(
	'/',
	'/abc',
	'/abc/d',
	'/books/13',
	'/books/13/java',
	'/admin',
	'/admin/',
	'/admin/abc',
	'/admin/abc/d',
);

foreach ($testarr as $item){
	dump($routes->filter($_GET,$item),$item);	
}



?>

评论(7)

  1. #7 楼 · vb2005xu · 2012-06-13 11:51

    http://www.pjhome.net/default.asp?cateID=1

  2. #6 楼 · vb2005xu · 2012-06-11 17:31

    http://www.gantry-framework.org/

  3. #5 楼 · vb2005xu · 2012-06-11 16:52

    http://taffydb.com/

  4. #4 楼 · vb2005xu · 2012-06-11 10:30

    http://www.appelsiini.net/projects/viewport

  5. #3 楼 · vb2005xu · 2012-06-09 16:17

    http://www.qwrap.com/download.html 百度的js前端框架

  6. #2 楼 · vb2005xu · 2012-06-09 11:23

    http://graphicdesignjunction.com/2011/09/25-latest-jquery-plugins/ jquery 扩展

  7. #1 楼 · vb2005xu · 2012-06-09 10:19

    http://www.clearbox.hu/index_en.html#4 很不错的lightbox效果

评论功能维护中,当前仅展示历史评论。