1. Go to this page and download the library: Download dillonsmart/tetherphp 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/ */
// app/Actions/Home/Index.php
class Index extends Action implements ActionInterface
{
public function __construct(protected Request $request, Services $services)
{
$this->domain = new IndexDomain($services->env);
$this->responder = new IndexResponder($request);
}
public function __invoke(): Response
{
return $this->respond($this->domain->handle());
}
}
// app/Domains/Home/Index.php
class Index extends Domain
{
public function __construct(private readonly Env $env)
{
}
public function handle(): Page
{
return new Page(
name: $this->env->get('APP_NAME', 'TetherPHP'),
description: 'An application built with TetherPHP.',
);
}
}
// app/Responders/Home/Index.php
class Index extends Responder
{
public function __invoke(Page $result): Response
{
return $this->view('pages.home.index', [
'appName' => $result->name,
'tagline' => $result->description,
]);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.