PHP code example of baagee / nknkn

1. Go to this page and download the library: Download baagee/nknkn library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

baagee / nknkn example snippets


// app初始化后
\BaAGee\NkNkn\App::APP_AFTER_INIT_EVENT;
// 路由初始化前
\BaAGee\NkNkn\Router::ROUTER_BEFORE_INIT_EVENT;
// 路由初始化后
\BaAGee\NkNkn\Router::ROUTER_AFTER_INIT_EVENT;
// 路由匹配执行前
\BaAGee\NkNkn\Router::ROUTER_BEFORE_DISPATCH_EVENT
// 路由匹配执行后
\BaAGee\NkNkn\Router::ROUTER_AFTER_DISPATCH_EVENT 

baagee/async-task: php process task library https://github.com/baagee/async-task.git
baagee/php-config: PHP Config library https://github.com/baagee/php-config.git
baagee/php-cookie: PHP Cookie library https://github.com/baagee/php-cookie.git
baagee/php-curl-request: PHP Curl Request library https://github.com/baagee/php-curl-request.git
baagee/php-debug-trace: PHP Debug Trace https://github.com/baagee/php-debugtrace.git
baagee/php-event: PHP event library https://github.com/baagee/php-event.git
baagee/php-log: PHP Log library https://github.com/baagee/php-log.git
baagee/php-mysql: PHP mysql library https://github.com/baagee/php-mysql.git
baagee/php-onion: PHP onion layer https://github.com/baagee/php-onion.git
baagee/php-params-validator: PHP Params Validator Library https://github.com/baagee/php-params-validator.git
baagee/php-router: PHP Router library https://github.com/baagee/php-router.git
baagee/php-session: PHP Session library https://github.com/baagee/php-session.git
baagee/php-template: PHP Template library https://github.com/baagee/php-template.git
baagee/wtf-error: What the fuck! PHP error handler https://github.com/baagee/wtf-error.git
psr/container: Common Container Interface (PHP FIG PSR-11) https://github.com/php-fig/container.git

$> php ./vendor/bin/creater ./ appName                                                                                                                                                                                                                [11:05:52]
创建文件夹:app 成功
创建文件夹:app/Action 成功
创建文件夹:app/Controller 成功
创建文件夹:app/Event 成功
创建文件夹:app/Library 成功
创建文件夹:app/Middleware 成功
创建文件夹:app/Model 成功
创建文件夹:app/Script 成功
创建文件夹:app/View 成功
创建文件夹:config 成功
创建文件夹:runtime 成功
创建文件夹:public 成功
public/index.php 创建成功
composer.json 添加自动加载命名空间App
app/routes.php 创建成功
app/Middleware/ReturnJson.php 创建成功
app/Action/Test/Hello.php 创建成功
尝试访问一下 /api/hello
OVER