pointotech/code-igniter-tools

CodeIgniter 开发工具。

1.0.1 2020-11-26 04:49 UTC

This package is auto-updated.

Last update: 2024-09-26 13:51:49 UTC


README

CodeIgniter 开发工具。

安装

composer require pointotech/code-igniter-tools

使用

这段代码应在 CodeIgniter 控制器内调用,因为它依赖于 CodeIgniter 定义的数组和函数。

use Pointotech\CodeIgniter\Tools\CodeIgniterRoutesFinder;

echo "# Routes\n\n";
foreach (CodeIgniterRoutesFinder::all_routes() as $route_url => $controller_method) {
  echo "- " . $route_url . ': ' . (is_string($controller_method) ? $controller_method : json_encode($controller_method)) . "\n";
}

echo "\n## Routing options\n\n";
$routes_options = CodeIgniterRoutesFinder::routing_options();
echo "- default_controller_url: " . $routes_options->default_controller_url() . "\n";
echo "- translate_uri_dashes: " . ($routes_options->translate_uri_dashes() ? "Yes" : "No") . "\n";

示例输出

# Routes

- routes/index: Routes::index
- welcome/index: Welcome::index
- 404_override:

## Routing options

- default_controller_url: welcome
- translate_uri_dashes: No