1. Go to this page and download the library: Download naf/cms 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 Naf\CMS\Enums\Permission;
use Naf\CMS\Page\Page;
use function Naf\View\view;
cms()->pages()->add(
Page::create('plugin.reports')
->setPath('/admin/reports')
->setTitle('Reports')
->setLayout('admin')
->
use Naf\CMS\Enums\Scope;
use Naf\CMS\Navigation\NavigationItem;
cms()->scope(Scope::ADMIN)->navigation()->add(
NavigationItem::create('plugin.reports')
->setLabel('Reports')
->setHref('/admin/reports')
->setParent('content')
->setIcon('stats')
);
use Naf\CMS\Contracts\MediaStorageInterface;
use App\Media\S3MediaStorage;
use function Naf\app;
app()->container()->set(
MediaStorageInterface::class,
static fn(): MediaStorageInterface => new S3MediaStorage(),
);
use Naf\CMS\Events\CmsEvent;
use Naf\CMS\Events\ContentEvent;
use function Naf\event;
use function Naf\log;
event()->listen(CmsEvent::PAGE_PUBLISHED, fn (ContentEvent $e) => log()->info('Page published', ['pageId' => $e->subjectId]));
event()->listen(CmsEvent::ARTICLE_PUBLISHED, [ClearCacheListener::class, 'handle']); // built through the container
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.