Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
/ oc-CRUD-plugin Public archive

Sample OctoberCMS plugin to demonstrate creating CRUD features for existing backend models/controllers within the frontend.

License

Notifications You must be signed in to change notification settings

inetis-ch/oc-CRUD-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Sample OctoberCMS plugin to demonstrate creating CRUD features for existing backend models/controllers within the frontend.

NOTE: This plugin is NOT production ready. Additional security checks and verification steps MUST be added before implementing on a production site.

Demo

CRUD demo

Usage

This plugin demonstrates the following three components:

crudList

Displays a list of items and adds ability to delete items when clicking on the delete button.

Property Description Example
Model The full class name of the model you want to use (with namespace) \Dev\Plugin\Models\User
Field to display The name of the property you want to display in the list title
Page Edit Item The page that contains the crudUpdate component (used by the Edit buttons) update.htm
Page New Item The page that contain the crudCreate component (used by the New item button) create.htm

crudUpdate

Displays an edit form.

Property Description Example
Model The full class name of the model you want to use (with namespace) Dev\Plugin\Models\User
Controller The full class name of the controller you want to use (with namespace) Dev\Plugin\Controllers\Users
Form context The context you want to use (see Backend forms > Field options > Context) frontend
ID The primary key of the item you want to edit (can be a URL parameter) {{ :id }}
Form config (optional) Override the default form configuration file (fields.yaml) defined in the controller (config_form.yaml) (see Backend forms > Defining form fields $/dev/plugin/models/user/fields.yaml
Success page The Page to redirect the user after model has correctly saved update.htm

crudCreate

Displays a create form

Property Description Example
Model The full class name of the model you want to use (with namespace) Dev\Plugin\Models\User
Controller The full class name of the controller you want to use (with namespace) Dev\Plugin\Controllers\Users
Form context The context you want to use (see Backend forms > Field options > Context) frontend
ID Primary key of the item you want edit
Form config (optional) Override the default form configuration file (fields.yaml) defined in the controller (config_form.yaml) (see Backend forms > Defining form fields $/dev/plugin/models/user/fields.yaml
Success page The Page to redirect the user after model has correctly saved update.htm

Current Limitations

  • Backend widget are not supported (the DOM is generated but without any JS/CSS) - Any PRs are welcome
  • No access validation, anybody with access to the routes that these components live on can update your models without authorization or validation.

Author

inetis is a webdesign agency in Vufflens-la-Ville, Switzerland. We love coding and creating powerful apps and sites see our website.

About

Sample OctoberCMS plugin to demonstrate creating CRUD features for existing backend models/controllers within the frontend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published