Giter Site home page Giter Site logo

inetis-ch / oc-crud-plugin Goto Github PK

View Code? Open in Web Editor NEW
18.0 7.0 4.0 8 KB

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

License: MIT License

PHP 91.87% HTML 8.13%
octobercms octobercms-plugin crud-application

oc-crud-plugin's Introduction

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.

oc-crud-plugin's People

Contributors

chvuagniaux avatar luketowers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.