update readme for the route syntax
This commit is contained in:
parent
e4fb8b6d31
commit
61bdba5ad4
2 changed files with 20 additions and 17 deletions
|
@ -6,6 +6,13 @@ table, and you may dispatch the URL based on the transition table in C.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Pattern Syntax
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
/blog/post/{id} use [^/]+ regular expression by default.
|
||||||
|
|
||||||
|
/blog/post/{id:\d+} use `\d+` regular expression instead of default.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Use case in PHP
|
Use case in PHP
|
||||||
|
@ -14,7 +21,7 @@ Use case in PHP
|
||||||
```php
|
```php
|
||||||
// Here is the paths data structure
|
// Here is the paths data structure
|
||||||
$paths = [
|
$paths = [
|
||||||
'/blog/post/:id' => [ 'controller' => 'PostController', 'action' => 'item', 'method' => 'GET' ],
|
'/blog/post/{id}' => [ 'controller' => 'PostController', 'action' => 'item', 'method' => 'GET' ],
|
||||||
'/blog/post' => [ 'controller' => 'PostController', 'action' => 'list', 'method' => 'GET' ],
|
'/blog/post' => [ 'controller' => 'PostController', 'action' => 'list', 'method' => 'GET' ],
|
||||||
'/blog/post' => [ 'controller' => 'PostController', 'action' => 'create', 'method' => 'POST' ],
|
'/blog/post' => [ 'controller' => 'PostController', 'action' => 'create', 'method' => 'POST' ],
|
||||||
'/blog' => [ 'controller' => 'BlogController', 'action' => 'list', 'method' => 'GET' ],
|
'/blog' => [ 'controller' => 'BlogController', 'action' => 'list', 'method' => 'GET' ],
|
||||||
|
|
28
configure.ac
28
configure.ac
|
@ -1,24 +1,20 @@
|
||||||
AC_INIT([r2],[1.4],[yoanlin93@gmail.com],[r2],[http://github.com/c9s/r2])
|
# -*- Autoconf -*-
|
||||||
# AC_CONFIG_AUX_DIR(config)
|
# Process this file with autoconf to produce a configure script.
|
||||||
# AC_CONFIG_SRCDIR(Front/mona.cpp)
|
|
||||||
# AM_INIT_AUTOMAKE()
|
AC_PREREQ([2.69])
|
||||||
|
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
|
||||||
|
AC_CONFIG_SRCDIR([config.h.in])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
CFLAGS=$CXXFLAGS
|
# Checks for programs.
|
||||||
AC_SUBST(CFLAGS)
|
AC_PROG_CC
|
||||||
|
|
||||||
AC_HEADER_STDC
|
# Checks for libraries.
|
||||||
|
|
||||||
AC_CHECK_HEADERS(stdlib.h string.h sys/time.h unistd.h
|
# Checks for header files.
|
||||||
,,AC_MSG_ERROR(required header file not found))
|
|
||||||
|
|
||||||
dnl ========== checks for typedefs, structures, and compiler characteristics ==========
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
|
||||||
AC_C_CONST
|
# Checks for library functions.
|
||||||
AC_C_INLINE
|
|
||||||
AC_TYPE_SIZE_T
|
|
||||||
|
|
||||||
AC_FUNC_MALLOC
|
|
||||||
AC_FUNC_MEMCMP
|
|
||||||
AC_FUNC_MMAP
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
Loading…
Reference in a new issue