PHP code example of afuafuyo / fatephp

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

    

afuafuyo / fatephp example snippets


路由格式

/index.php?r=[route_prefix|moduleId]/[controllerId]

index.php


e\web\Application([
    'id'=>1, 
    'appPath'=> __DIR__ . '/app',
    'modules' => [
        'reg' => 'app\\modules\\reg'
    ],
    'db' => [
        'main' => [
            'dsn' => 'mysql:host=localhost;dbname=xxx',
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8'
        ]
    ],
    'cache' => [
        'file' => [
            'class' => 'fate\cache\file\Cache'
        ]
    ],
    'log' => [
        'targets' => [
            'file' => [
                'class' => 'fate\log\file\Log'
            ]
        ]
    ]

]))->run();