sy / bootstrap-cms
Plugin for adding CMS feature
Installs: 310
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 6
Language:JavaScript
Requires
- php: >=7
- masterminds/html5: ^2.8
- scssphp/scssphp: *
- sy/bootstrap: *
Requires (Dev)
- phpunit/phpunit: ^10
- dev-develop
- 1.20.1
- 1.20.0
- 1.19.1
- 1.19.0
- 1.18.8
- 1.18.7
- 1.18.6
- 1.18.5
- 1.18.4
- 1.18.3
- 1.18.2
- 1.18.1
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.1
- 1.14.0
- 1.13.5
- 1.13.4
- 1.13.3
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.10
- 1.12.9
- 1.12.8
- 1.12.7
- 1.12.6
- 1.12.5
- 1.12.4
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.4
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.1
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.8.1
- 0.8.0
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1.0
- dev-master
This package is auto-updated.
Last update: 2024-11-02 17:01:46 UTC
README
sy/bootstrap plugin for adding "CMS" feature in your sy/project based application.
Installation
From your sy/project based application directory, run this command:
composer install-plugin cms
It's equivalent to:
composer require sy/bootstrap-cms
NOTES
The install-plugin command will do all these following steps:
- Run composer require
- Copy templates files
- Create flyway migration file
- Copy assets files
- Run composer build
- Run composer db migrate
Page methods
Create a method in your Project\Application\Page
class (in protected/src/Application/Page.php
):
/** * Content page */ public function contentAction() { $this->setContentVars([ 'CONTENT' => new \Sy\Bootstrap\Component\Cms\Content($this->get('id', 1)), ]); }
Optionally, override the home page with the content page
/** * Home page */ public function homeAction() { $this->copy('content'); }
Add URL converter in Application.php
In protected/src/Application.php
<?php namespace Project; use Sy\Bootstrap\Lib\Url; class Application extends \Sy\Bootstrap\Application { protected function initUrlConverter() { Url\AliasManager::setAliasFile(__DIR__ . '/../conf/alias.php'); Url::addConverter(new Url\AliasConverter()); Url::addConverter(new Url\ContentConverter()); // Add the content URL converter Url::addConverter(new Url\ControllerActionConverter()); } }
Add the content pages sitemap in Sitemap.php
In protected/src/Application/Sitemap.php
<?php namespace Project\Application; class Sitemap extends \Sy\Bootstrap\Application\Sitemap { public function __construct() { parent::__construct(); $this->addProvider(new \Sy\Bootstrap\Application\Sitemap\Page()); $this->addProvider(new \Sy\Bootstrap\Application\Sitemap\Content()); // Add the content sitemap } }