PHP code example of reaway / think-facade

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

    

reaway / think-facade example snippets



namespace think;

class App
{
    public function name() 
    {
        return 'app';
    }
}


namespace app\facade;

use Think\Component\Facade\Facade;

class App extends Facade
{
    /**
     * 获取当前Facade对应类名
     * @access protected
     * @return string
     */
    protected static function getFacadeClass()
    {
        return '\think\App';
    }
}

use app\facade\App;

echo App::name(); // app