PHP code example of app2641 / garnet-beans

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

    

app2641 / garnet-beans example snippets



define('LIB', '/Users/hoge/Desktop/app/library');
define('APP', 'App');


use Emerald\CLI;

$cli = CLI::getInstance();
$cli->execute($argv);


use Garnet\Container,
	App\Factory\ModelFactory;
	
$container  = new Container(new ModelFactory);
$user_model = $container->get('UserModel');

$user_model->fetchById(1);
echo $user_model->get('name');