PHP code example of wangyu / reflex-core

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

    

wangyu / reflex-core example snippets


use WangYu\Reflex;

$reflex = Reflex($object);

$reflex = Reflex($object);
$actionReflex = $reflex->setMethod($action);

/**
 * Class Book
 * @route('v1/book')
 * @package app\api\controller\v1
 */
class Book
{
}

$route = $reflex->get('route',['rule']);

$route = {
    ['rule' => '/v1/book/']
}

/**
 * 查询指定bid的图书
 * @route('v1/book/:bid','get')
 * @param Request $bid
 * @param('bid','bid的图书','

$route = $actionReflex->get('route',['rule','method']);

$route = {
    ['rule' => '/v1/book/','method' => 'get']
}

/**
 * 查询指定bid的图书
 * @route('v1/book/:bid','get')
 * @param Request $bid
 * @param('bid','bid的图书',';
}

$route = $actionReflex->isExist('auth');

$route = true;  # 代表存在