PHP code example of zhengyouke / zyk

1. Go to this page and download the library: Download zhengyouke/zyk 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/ */

    

zhengyouke / zyk example snippets




define('BEHAVIOR_PATH', '\\zyk\\library\\Behavior\\');
return [
    // 应用初始化
    'app_init'     => [BEHAVIOR_PATH.'InitBase'],
    // 应用开始
    'app_begin'    => [],
    // 模块初始化
    'module_init'  => [],
    // 操作开始执行
    'action_begin' => [],
    // 视图内容过滤
    'view_filter'  => [],
    // 日志写入
    'log_write'    => [],
    // 应用结束
    'app_end'      => [],
];

    'Auth' => 'app\\api\\middleware\\Auth',
    'Permit' => 'zyk\\library\\Middleware\\Permit'


app(AuthUser::class);

// 如 读取用户权限
app(AuthUser::class)->getRoles();

'exception_handle'  => '\\zyk\\library\\Exception\\Http'