1. Go to this page and download the library: Download ethicks/filtcms 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/ */
ethicks / filtcms example snippets
use EthickS\FiltCMS\FiltCMSPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FiltCMSPlugin::make(),
]);
}
use EthickS\FiltCMS\Facades\FiltCMS;
// Get a page
$page = FiltCMS::page('about-us');
if ($page->exists()) {
echo $page->getTitle();
echo $page->getBody();
echo $page->getExcerpt();
echo $page->getFeaturedImage();
echo $page->getViewsCount();
echo $page->getLikesCount();
echo $page->getCommentsCount();
}
// Get a blog post
$blog = FiltCMS::blog('my-post-slug');
if ($blog->exists()) {
echo $blog->getTitle();
echo $blog->getBody();
print_r($blog->getTags());
echo $blog->getCategory()->name;
echo $blog->getAuthor()->name;
}