PHP Classes

How to Provide a PHP Website Builder that Lets Users Manage Website Pages using the Package Yii2 Website Module: Add a content page management system to a site

Recommend this page to a friend!
  Info   View files Documentation   View files View files (121)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-07-24 (Yesterday) RSS 2.0 feedNot yet rated by the usersTotal: 6 This week: 6All time: 11,388 This week: 10Up
Version License PHP version Categories
yii2-website-module 1.0BSD License5PHP 5, Libraries, Content management
Description 

Author

This package can add a content page management system to a site.

It provides a Web application that can be added to a site to manage and publish pages to a site.

The package provides a backend that allows users to manage pages with navigation menus.

It also provides a frontend that can publish the managed pages.

Picture of Gabriel Alejandro López López
  Performance   Level  
Name: Gabriel Alejandro López ... <contact>
Classes: 9 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 3x

Documentation

Yii2 Website Module

Latest Stable Version Total Downloads Latest Unstable Version License

Yii2 module to implement a website.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist daxslab/yii2-website-module "*"

or add

"daxslab/yii2-website-module": "*"

to the require section of your composer.json file.

Introduction

Website tries to be an unobstrusive CMS without limiting the capabilities of Yii2 framework as development platform. The idea is that you can add website features to an existing application, or just create a website based on Yii2 framework.

The idea behind Website module is a bit different compared with other CMS. While generally pages, posts and categories are managed, in Website everything is a page and every page can have children pages so,

  • a page without subpages can be considered a regular _page_
  • a page with subpages can be considered a _category_
  • a subpage can be considered a _post_

The resulting tree can then have wathever depth is required.

Besides pages, Website also manages Media: any attached file that can be referenced in the resulting website. The module handles the uploading process.

Also you can manage Menus with Website module. For every menu you can create menu items and this than be pointed to any URL. When creating a menu item you either type the label and URL, or select from existing pages.

Configuration

Website is meant to be used with the Yii2 Advanced Application template. Some modification could be done to make it usable with basic template.

Module

First configure the module for all the apps in common/config/main.php

//...
'modules' => [
	'website' => [
		'class' => daxslab\website\Module::class,
		'languages' => ['en', 'es', 'it'],
		'token' => 'some-string-here'
	]
]
//...

Here notice the specified attributes: - languages: array with the languages that will be active for creating content - token: string identifying every website in case that several are used.

Database

It is assumed that you are using some database and that the connection to it it's already set. Configure migrations in console/config/main.php

//...
'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationNamespaces' => [
            'daxslab\website\migrations',
        ]
    ],
],
//...

Controllers

Configure controllers namespaces for the module in each app. Let's start with frontend/config/main.php

//...
'modules' => [
	'website' => [
		'controllerNamespace' => 'daxslab\website\controllers\frontend'
	]
]
//...

And similar for backend/config/main.php

//...
'modules' => [
	'website' => [
		'controllerNamespace' => 'daxslab\website\controllers\backend'
	]

]
//...

Usage

The module provides two sets of controllers: frontend and backend.


  Files folder image Files  
File Role Description
Files folder imageassets (2 directories)
Files folder imagebehaviors (1 file)
Files folder imagecommands (1 file)
Files folder imagecomponents (1 file)
Files folder imagecontrollers (2 directories)
Files folder imagemessages (1 file, 1 directory)
Files folder imagemigrations (12 files)
Files folder imagemodels (25 files)
Files folder imageviews (2 directories)
Files folder imagewidgets (1 file)
Plain text file Bootstrap.php Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Plain text file Module.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Plain text file WebsiteAsset.php Class Class source

  Files folder image Files  /  assets  
File Role Description
Files folder imagecss (1 file)
Files folder imagejs (2 files, 1 directory)

  Files folder image Files  /  assets  /  css  
File Role Description
  Accessible without login Plain text file backend.css Data Auxiliary data

  Files folder image Files  /  assets  /  js  
File Role Description
Files folder imageckeditor (2 directories)
  Accessible without login Plain text file backend.js Data Auxiliary data
  Accessible without login Plain text file jquery.fn.sortable.js Data Auxiliary data

  Files folder image Files  /  assets  /  js  /  ckeditor  
File Role Description
Files folder imageimagebrowser (3 files, 1 directory)
Files folder imageshowprotected (1 file, 2 directories)

  Files folder image Files  /  assets  /  js  /  ckeditor  /  imagebrowser  
File Role Description
Files folder imagebrowser (4 files)
  Accessible without login Plain text file LICENSE.txt Doc. Documentation
  Accessible without login Plain text file plugin.js Data Auxiliary data
  Accessible without login Plain text file README.rst Doc. Documentation

  Files folder image Files  /  assets  /  js  /  ckeditor  /  imagebrowser  /  browser  
File Role Description
  Accessible without login Plain text file browser.css Data Auxiliary data
  Accessible without login HTML file browser.html Doc. Documentation
  Accessible without login Plain text file browser.js Data Auxiliary data
  Accessible without login Plain text file jquery-1.9.1.min.js Data Auxiliary data

  Files folder image Files  /  assets  /  js  /  ckeditor  /  showprotected  
File Role Description
Files folder imagedialogs (1 file)
Files folder imageimages (1 file)
  Accessible without login Plain text file plugin.js Data Auxiliary data

  Files folder image Files  /  assets  /  js  /  ckeditor  /  showprotected  /  dialogs  
File Role Description
  Accessible without login Plain text file protected.js Data Auxiliary data

  Files folder image Files  /  assets  /  js  /  ckeditor  /  showprotected  /  images  
File Role Description
  Accessible without login Image file code.gif Icon Icon image

  Files folder image Files  /  behaviors  
File Role Description
  Plain text file SluggableBehavior.php Class Class source

  Files folder image Files  /  commands  
File Role Description
  Plain text file CreateController.php Class Class source

  Files folder image Files  /  components  
File Role Description
  Plain text file Lookup.php Class Class source

  Files folder image Files  /  controllers  
File Role Description
Files folder imagebackend (7 files)
Files folder imagefrontend (3 files)

  Files folder image Files  /  controllers  /  backend  
File Role Description
  Plain text file MediaController.php Class Class source
  Plain text file MenuController.php Class Class source
  Plain text file MenuItemController.php Class Class source
  Plain text file MetadataDefinitionController.php Class Class source
  Plain text file PageController.php Class Class source
  Plain text file PageTypeController.php Class Class source
  Plain text file WebsiteController.php Class Class source

  Files folder image Files  /  controllers  /  frontend  
File Role Description
  Plain text file BaseController.php Class Class source
  Plain text file BlockController.php Class Class source
  Plain text file PageController.php Class Class source

  Files folder image Files  /  messages  
File Role Description
Files folder imagees (1 file)
  Accessible without login Plain text file config.php Aux. Configuration script

  Files folder image Files  /  messages  /  es  
File Role Description
  Accessible without login Plain text file website.php Aux. Configuration script

  Files folder image Files  /  migrations  
File Role Description
  Plain text file m190103_202248_create_website_table.php Class Class source
  Plain text file m190104_004059_cre...page_type_table.php Class Class source
  Plain text file m190104_004730_create_page_table.php Class Class source
  Plain text file m190105_014225_create_menu_table.php Class Class source
  Plain text file m190105_014226_cre...menu_item_table.php Class Class source
  Plain text file m190105_054132_create_media_table.php Class Class source
  Plain text file m190122_230350_cre...efinition_table.php Class Class source
  Plain text file m190123_131635_create_metadata_table.php Class Class source
  Plain text file m200815_005933_add...efinition_table.php Class Class source
  Plain text file m200815_224355_add...page_type_table.php Class Class source
  Plain text file m200818_121205_add...page_type_table.php Class Class source
  Plain text file Migration.php Class Class source

  Files folder image Files  /  models  
File Role Description
  Plain text file ActiveRecord.php Class Class source
  Plain text file Media.php Class Class source
  Plain text file MediaQuery.php Class Class source
  Plain text file MediaSearch.php Class Class source
  Plain text file Menu.php Class Class source
  Plain text file MenuItem.php Class Class source
  Plain text file MenuItemQuery.php Class Class source
  Plain text file MenuItemSearch.php Class Class source
  Plain text file MenuQuery.php Class Class source
  Plain text file MenuSearch.php Class Class source
  Plain text file Metadata.php Class Class source
  Plain text file MetadataDefinition.php Class Class source
  Plain text file MetadataDefinitionQuery.php Class Class source
  Plain text file MetadataDefinitionSearch.php Class Class source
  Plain text file MetadataQuery.php Class Class source
  Plain text file Page.php Class Class source
  Plain text file PageQuery.php Class Class source
  Plain text file PageSearch.php Class Class source
  Plain text file PageType.php Class Class source
  Plain text file PageTypeQuery.php Class Class source
  Plain text file PageTypeSearch.php Class Class source
  Plain text file PageTypeSsearch.php Class Class source
  Plain text file Website.php Class Class source
  Plain text file WebsiteQuery.php Class Class source
  Plain text file WebsiteSearch.php Class Class source

  Files folder image Files  /  views  
File Role Description
Files folder imagebackend (8 directories)
Files folder imagefrontend (2 directories)

  Files folder image Files  /  views  /  backend  
File Role Description
Files folder imagebase (1 file)
Files folder imagemedia (9 files)
Files folder imagemenu-item (5 files)
Files folder imagemenu (4 files)
Files folder imagemetadata-definition (5 files)
Files folder imagepage-type (4 files)
Files folder imagepage (8 files)
Files folder imagewebsite (3 files)

  Files folder image Files  /  views  /  backend  /  base  
File Role Description
  Accessible without login Plain text file index.php Aux. Configuration script

  Files folder image Files  /  views  /  backend  /  media  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file images-gallery.php Aux. Configuration script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Accessible without login Plain text file view.php Example Example script
  Accessible without login Plain text file _form.php Example Example script
  Accessible without login Plain text file _image.php Example Example script
  Accessible without login Plain text file _search.php Example Example script
  Accessible without login Plain text file _view.php Example Example script

  Files folder image Files  /  views  /  backend  /  menu-item  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Accessible without login Plain text file _form.php Example Example script
  Accessible without login Plain text file _view.php Example Example script

  Files folder image Files  /  views  /  backend  /  menu  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Accessible without login Plain text file _form.php Example Example script

  Files folder image Files  /  views  /  backend  /  metadata-definition  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Plain text file _form.php Class Class source
  Accessible without login Plain text file _view.php Example Example script

  Files folder image Files  /  views  /  backend  /  page-type  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Plain text file _form.php Class Class source

  Files folder image Files  /  views  /  backend  /  page  
File Role Description
  Accessible without login Plain text file create.php Example Example script
  Accessible without login Plain text file index.php Example Example script
  Accessible without login Plain text file update.php Example Example script
  Plain text file _form.php Class Class source
  Accessible without login Plain text file _list-gallery.php Example Example script
  Accessible without login Plain text file _list.php Example Example script
  Accessible without login Plain text file _view-gallery.php Example Example script
  Accessible without login Plain text file _view.php Example Example script

  Files folder image Files  /  views  /  backend  /  website  
File Role Description
  Accessible without login Plain text file update.php Example Example script
  Accessible without login Plain text file view.php Example Example script
  Accessible without login Plain text file _form.php Example Example script

  Files folder image Files  /  views  /  frontend  
File Role Description
Files folder imageblock (4 files)
Files folder imagepage (7 files)

  Files folder image Files  /  views  /  frontend  /  block  
File Role Description
  Accessible without login Plain text file carousel.php Example Example script
  Accessible without login Plain text file category-item.php Example Example script
  Accessible without login Plain text file category.php Example Example script
  Accessible without login Plain text file gallery.php Example Example script

  Files folder image Files  /  views  /  frontend  /  page  
File Role Description
  Accessible without login Plain text file gallery.php Example Example script
  Accessible without login Plain text file landing.php Example Example script
  Accessible without login Plain text file list.php Example Example script
  Accessible without login Plain text file page.php Example Example script
  Accessible without login Plain text file _header.php Example Example script
  Accessible without login Plain text file _list-view.php Example Example script
  Accessible without login Plain text file _page-view.php Example Example script

  Files folder image Files  /  widgets  
File Role Description
  Plain text file PageWidgetizer.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:6
This week:6
All time:11,388
This week:10Up