ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

v 1.3.3 grocery CRUD - an automatic Codeigniter CRUD

April 11, 2011 3:24am

Subscribe [77]
  • #1 / Apr 11, 2011 3:24am

    web-johnny

    235 posts

    Codeigniter CRUD - NEW version of grocery CRUD v.1.3.3
    Grocery CRUD is a codeigniter CRUD library that makes a php developer’s life easier.
    You don’t need so much line of codes, models , views, libraries to make a CRUD works. Just few lines of code and a stable CRUD is ready. You don’t need any codeigniter CRUD tutorial to use it. Even for complex CRUDs you can use it by adding callbacks. You can choose the CRUD template that you want to use by changing only the theme , for now on I have two themes: flexigrid and datatables. You are able to build the grid and the forms easily and automatically by using the power of jquery.

    Some features of this CRUD for Codeigniter are:
    - automatic creation of the grid and choosing about 2 two themes.
    - automatic creation of the forms and the inputs by field type
    - quick relation per field
    - changing easily themes.
    - multilingual functionality
    - validation form with the function set_rules same as codeigniter’s
    - choosing columns, add fields, edit fields that we want to use in our CRUD
    - uploading files
    - relation 1 to many (1-n) and many to many (n-n)
    - callbacks almost everywhere
    - paging, sorting asc, sorting desc, searching by field or search for all with ajax.
    ...and many others that you can see them from the user guide I created to my personal website.

    The version grocery CRUD v.1.3.3 supports Codeigniter 2 (included the new Codeigniter 2.1.3). You can read the user guide and download the CRUD from the link below.

    View user guide and download the CRUD by clicking here.

    Grocery CRUD is released with dual licensing, using the GPL v3 and the MIT license. For more read grocery CRUD licence.

    A sample code of how a controller will be is the below example (just an example)

    if ( ! defined('BASEPATH')) exit('No direct script access allowed');
     
    class Examples extends CI_Controller {
    
     
        function __construct()
        {
            parent::__construct();
                  
            $this->load->library('grocery_CRUD');    
        }
     
        function customers()
        {
            $this->grocery_crud->set_subject('Customer');
            $this->grocery_crud->set_table('customers');
            $this->grocery_crud->columns('customerName','phone','addressLine1','creditLimit');
     
            $output = $this->grocery_crud->render();
    
            $this->_example_output($output);
    
        }
    
        function _example_output($output = null)
        {
            $this->load->view('example.php',$output);    
        }
    }
  • #2 / Apr 11, 2011 3:49am

    toopay

    1583 posts

    Wow, nice post. I like the way you name it ‘grocery’ instead ‘e-commerce’(or other e-stuffs), it sounds more simple and friendly 😊

  • #3 / Apr 11, 2011 3:49am

    Haskabab

    25 posts

    why would i use a crud.. to save some lines of code?

  • #4 / Apr 11, 2011 5:47am

    web-johnny

    235 posts

    Not only to save some lines of codes. CRUDs has lot of similar things. You don’t have to do every time copy-paste thousands lines of codes and views and don’t know what works and what not and test them again and again.
    For example if you have a database with 40 tables. It will take a while to create a CMS.
    Of course if you want to do more complex things it will take more lines in CRUD of course , but the lines will be more “business logic” lines (more php less html). With the transitional way it will take lot of time to create views, javascripts , html, lot of css , many javascripts errors, bugs etc.

    Also is a good solution for those who used scaffolding . Its a quick and easy way to use it in codeigniter 2.0.0

  • #5 / Apr 12, 2011 7:44am

    George Tavas

    5 posts

    Wow!
    I’m amazed with the features of the grocery CRUD.
    Very nice job indeed.

    I developed an administration area in a few hours with it.

    Thanks a lot mate! :-D

  • #6 / Apr 12, 2011 5:01pm

    web-johnny

    235 posts

    Thanks 😊

  • #7 / Apr 16, 2011 11:12am

    Haskabab

    25 posts

    Alright, I do use alot of the same functions for different tables etc. I will look into it :D thanks for contributing ^^

  • #8 / Apr 16, 2011 12:12pm

    deadelvis

    24 posts

    Decided to try it out but FIY… works fine on 2.0.1 but it seems to be broken on 2.0.2 / Reactor. I am guessing due to changes in system/core/Config.php.

    A PHP Error was encountered
    Severity: Warning
    Message: include(application/third_party/config/grocery_crud.php) [function.include]: failed to open stream: No such file or directory
    Filename: core/Config.php
    Line Number: 115
    
    A PHP Error was encountered
    Severity: Warning
    Message: include() [function.include]: Failed opening 'application/third_party/config/grocery_crud.php' for inclusion (include_path='.:/Applications/MAMP/bin/php5.3/lib/php')
    Filename: core/Config.php
    Line Number: 115
    
    An Error Was Encountered
    Your application/third_party/config/grocery_crud.php file does not appear to contain a valid configuration array.

    Haven’t yet figured out where to edit to fix.

  • #9 / Apr 16, 2011 1:01pm

    web-johnny

    235 posts

    Actually codeigniter 2.0.2 is a little bit buggy I think!
    I will check why this error is happening.
    Thank you for the advice.

  • #10 / Apr 16, 2011 4:07pm

    web-johnny

    235 posts

    Ok actually is not a simple change for me. So I renamed the “for codeigniter CI 2.0.x” and I made it “for codeigniter CI 2.0.1”. Of course and the codeigniter CI 2.0.0 users are able to use it.
    Probably I will fix a patch or a new tag for codeigniter 2.0.2 .
    Thanks

  • #11 / Apr 17, 2011 7:14am

    RJ

    179 posts

    ah man!  I just downloaded gcrud and now i can’t use it :-((  oh well.. let us know when you are 2.0.2 compatible.  thanks for the contribution!

  • #12 / Apr 17, 2011 5:38pm

    tieungao

    30 posts

    I try to embed this at my current project but seem have many errors.

    Seems that auto create the title and the data table appear immediately after this.

    Can u provide me one example how to embed this like :

    $this->load->view(‘template/header’);
    $crud->render();
    $this->load->view(‘template/footer’);


    Thank so much.

  • #13 / Apr 17, 2011 5:45pm

    sajjad

    1 posts

    when i’m using wiredesignz codeigniter modular extensions i cnat do insert,delete and update in modules
    is there any solution?

    tanks

  • #14 / Apr 17, 2011 7:51pm

    web-johnny

    235 posts

    Decided to try it out but FIY… works fine on 2.0.1 but it seems to be broken on 2.0.2 / Reactor. I am guessing due to changes in system/core/Config.php.

    A PHP Error was encountered
    Severity: Warning
    Message: include(application/third_party/config/grocery_crud.php) [function.include]: failed to open stream: No such file or directory
    Filename: core/Config.php
    Line Number: 115
    
    A PHP Error was encountered
    Severity: Warning
    Message: include() [function.include]: Failed opening 'application/third_party/config/grocery_crud.php' for inclusion (include_path='.:/Applications/MAMP/bin/php5.3/lib/php')
    Filename: core/Config.php
    Line Number: 115
    
    An Error Was Encountered
    Your application/third_party/config/grocery_crud.php file does not appear to contain a valid configuration array.

    Haven’t yet figured out where to edit to fix.

    I create a new version of grocery CRUD v.1.0.1 for codeigniter 2.0.x . Actually this was a bug of codeigniter 2.0.2 (because I cannot include a config folder as module). But because we just need to do our job and keep going I create another way for the config files. The new version you will find it at google code hosting by clicking the below link

    grocery CRUD version 1.0.1 for codeigniter 2.0.x

    If you want just update your older files (from grocery CRUD v.1.0.0 to v.1.0.1) , just replace your old files with the new ones.

  • #15 / Apr 17, 2011 7:58pm

    web-johnny

    235 posts

    I try to embed this at my current project but seem have many errors.

    Seems that auto create the title and the data table appear immediately after this.

    Can u provide me one example how to embed this like :

    $this->load->view(‘template/header’);
    $crud->render();
    $this->load->view(‘template/footer’);


    Thank so much.

    Please be more specific. I cannot understand what the errors are. You can add your views to the top of your project or to the bottom of the project, as you show it

    $this->load->view('template/header');
    
    $crud = new grocery_CRUD();
    $crud->columns(....)->.....
    $crud->display_as(....
    $crud->render();
    
    $this->load->view('template/footer');

    if you want to add a template you can see how you can do it by see the documentation at the below link

    Installation for codeigniter

    There I show how you can add your custom-template (I named it custom-cms) . If you have any more issues just ask.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases