1. Go to this page and download the library: Download jimbojsb/adore 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/ */
// Route with plain path matching
$app->addRoute("/", "Homepage");
// Route with url parameters
$app->addRoute("/blog/post/{post_slug}", "BlogPost");
// Route that will only match on a POST request
$app->addRoute("/login", "Login", ["POST"]);
// Route with additional hard-coded parameters
$app->addRoute("/about", "StaticContent", ["file" => "about.md"]);
$app->run();
class MyAction
{
use \Adore\ActionTrait;
public function __invoke()
{
// business logic here
return new Responder($data);
}
}
class MyResponder
{
use \Adore\ResponderTrait;
public function __invoke()
{
// presentation logic here
$this->_response->content->set("Hello World");
}
}
index.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.