Coder Social home page Coder Social logo

josephjlee / grocery-crud-add-classes-required Goto Github PK

View Code? Open in Web Editor NEW

This project forked from treyeckels/grocery-crud-add-classes-required

0.0 0.0 0.0 180 KB

An extension to the popular CodeIgniter library Grocery Crud that allows you to add class name to fields and automatically adds required attribute and class name

License: MIT License

PHP 100.00%

grocery-crud-add-classes-required's Introduction

An extension to the popular CodeIgniter library Grocery Crud that allows you to add class name to fields and automatically adds required attribute and class names

The following fields types are affected by this extension:

  1. string
  2. integer
  3. true_false
  4. text
  5. datetime
  6. password
  7. date
  8. dropdown
  9. enum
  10. set
  11. multiselect
  12. relation
  13. relation_n_n

Getting started:

  1. Add the the extension file to your application -> libraries folder.
  2. Load the main crud library and the extension and instantiate the extension class. See below. Remember to instantiate the extension class and not the original grocery crud class.
$this->load->library('grocery_CRUD');
$this->load->library('extension_grocery_CRUD');
$this->crud = new Extension_grocery_CRUD();

Features

Required attr and class

This extensions adds the HTML5 required attribute as well as a required class name to any fields that are added to the grocery_CRUD->required_fields element.

Add class names to fields

It also adds a public method classes so that you can add class names to your field. It is nondestructive, so any class names already there by the grocer crud framework are preserved and added to the list of classnames.

Usage example:

$this->load->library('grocery_CRUD');
$this->load->library('extension_grocery_CRUD');
$this->crud = new Extension_grocery_CRUD();
$this->crud->classes('field_name', 'class1 class2 class3');

grocery-crud-add-classes-required's People

Contributors

treyeckels 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.