1. Go to this page and download the library: Download getkirby/database-storage 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/ */
use Kirby\Cms\Page;
use Kirby\DatabaseStorage\HasDatabaseChildren;
class CommentsPage extends Page
{
use HasDatabaseChildren;
public const DATABASE_CHILD_MODEL = CommentPage::class;
}
use Kirby\DatabaseStorage\DatabasePage;
class CommentPage extends DatabasePage
{
public const DATABASE_NAME = 'comments';
public const DATABASE_TABLE = 'comments';
public const DATABASE_FIELDS = [
'text',
'email',
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.