PHP code example of tanzaverse / 2f

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

    

tanzaverse / 2f example snippets

 
 
namespace App\Controllers; use App\Models\HomeModels;
use Core\View;
class Home extends \Core\Controller {
    function about(){
       
    }

}
 
 View::bindView('Your_folder_name/_your_filename.html',[
            
        ]);
 

 
namespace App\Models;
use PDO;
class HomeModels extends \Core\Model{
 public static function getAll()
 {
    $conn=static::getDB();// this is connection from database
 }
}



namespace App;

class Config
{

    /**
     * Database host
     * @var string
     */
    const DB_HOST = 'localhost';

    /**
     * Database name
     * @var string
     */
    const DB_NAME = 'clms';

    /**
     * Database user
     * @var string
     */
    const DB_USER = 'root';

    /**
     * Database password
     * @var string
     */
    const DB_PASSWORD = '';

    const SHOW_ERRORS=false;
}