1. Go to this page and download the library: Download sugiphp/sugi 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/ */
sugiphp / sugi example snippets
$app = new \SugiPHP\Sugi\App();
$app->route("HelloWorld", "/hello", function () {
echo "Hello World!";
});
$app->run();
use SugiPHP\Sugi\App;
// Instantiate SugiPHP Application:
$app = new App(["base_path" => dirname(__DIR__) . "/"]);
// Or use Singleton pattern:
$app = App::getInstance();
$app->log("debug", "Debug message");
$app->log("info", "user input was", $_POST);
$app["logger"]->error("my error message");
$app["logger"]->setLevel("warning");
$app["logger"]->info("this will not be logged");
$app->cache("key", "value");
echo $app->cache("key"); // returns "value"
// to access all methods for the cache you can use:
$app["cache"]->has("key"); // returns TRUE
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.