Download the PHP package ke/buildrouter without Composer

On this page you can find all versions of the php package ke/buildrouter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package buildrouter

建议使用go编写的新版本 https://github.com/wdaglb/thinkphp-annotation-route

KE-BuileRouter TP注解路由

兼容ThinkPHP 5.0与5.1,不兼容3.x

安装

使用

只需要使用composer安装扩展就自动加载,无需任何其它代码来启动

1.1 版本增加了常量KE_ROUTE_AUTO=0来关闭自动启动(需要在composer/autoload.php前定义)

当TP设置为调试模式时(也就是app_debug为true)时每次请求都会生成route/build_route.php
注意:如果是5.0则会生成application/build_route.php


部署时你应该使用下面命令生成路由表

配置(1.1+)

配置需要加在app.php

注解格式

与TP官方的差不多,目前只支持

在控制器类的方法注释中定义(通常称之为注解路由),例如:

请务必注意注释的规范,可以利用IDE生成规范的注释。

该方式定义的路由在调试模式下面实时生效,部署模式则需要使用 php think ke-buildrouter 指令生成路由规则文件。

注意必须严格使用@route((区分大小写,route和(之间不能有空格),建议路由定义写在注释最后一段,否则后面需要一个空行。

默认注册的路由规则是支持所有的请求,如果需要指定请求类型,可以在第二个参数中指定请求类型:

然后就使用下面的URL地址访问:

页面输出

关于URL生成

建议使用url函数生成

这里借用了官方文档

后续可能支持option参数的设置?


All versions of buildrouter with dependencies

PHP Build Version
Package Version
Requires topthink/framework Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ke/buildrouter contains the following files

Loading the files please wait ....