1. Go to this page and download the library: Download niku-solutions/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/ */
niku-solutions / cms example snippets
Niku\Cms\CmsServiceProvider::class,
use Niku\Cms\Http\Middlewares\WhitelistPostTypesMiddleware;
use Niku\Cms\Http\Middlewares\WhitelistConfigGroupsMiddleware;
protected $routeMiddleware = [
...
'posttypes' => WhitelistPostTypesMiddleware::class,
'groups' => WhitelistConfigGroupsMiddleware::class,
...
];
namespace App\Cms\PostTypes;
use Niku\Cms\Http\NikuPosts;
class Pages extends NikuPosts
{
// The label of the custom post type
public $label = 'Pages';
// Custom post type identifer
public $identifier = 'page';
// Users can only view their own posts when this is set to true
public $userCanOnlySeeHisOwnPosts = false;
public $config = [
];
// Setting up the template structure
public $templates = [
'default' => [
'customFields' => [
'post_content' => [
'component' => 'niku-cms-text-customfield',
'label' => 'Text',
'value' => '',
'validation' => '