Category Archives: Grocery CRUD

3
May

Image CRUD for Codeigniter

image-crud

So by now if you’re in the CodeIgniter scene i’m sure you’ve heard of grocery CRUD?! Well – the same guy, Johnny Skoumbourdis, who brought you grocery CRUD now brings you image CRUD.

Image CRUD is an automatic multiple image uploader for Codeigniter. With the same philoshopy of grocery CRUD library. Just simple line of codes and you have all the functionality that you need.

It really is easy to use, easy to implement and overall just really great!

Thanks Johnny! Hope this becomes apart of grocery CRUD in the near future!

To download image CRUD or view examples, click here.




25
Mar

Grocery CRUD – Dependent Dropdowns

Want to use categories with subcategories in Grocery CRUD? Or a vehicle list with models? Or dropdowns with Country, State and City? Below I have made an example using Grocery CRUD. Download the example and files here.

Step 1: Add the dependent dropdown data to your controller

Below are the basic setup details for your dependent dropdown. Just add it right below the “$output = $crud->render();” in your controller’s function.

  • dd_state = Gets the current CRUD state. E.g list, add etc.
  • dd_dropdowns = Set your dependent field variables here. In my example I used ‘countryID’,'stateID’ and ‘cityID’. The parent dropdown should always go first and its children should follow in order that they will be created.
  • dd_url = The URL to the function that gets and creates the child dropdown data. The parent URL always stays blank. They need to be in order as per the ‘dd_dropdowns’.
//DEPENDENT DROPDOWN SETUP
$dd_data = array(
    //GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD
    'dd_state' =>  $crud->getState(),
    //SETUP YOUR DROPDOWNS
    //Parent field item always listed first in array, in this case countryID
    //Child field items need to follow in order, e.g stateID then cityID
    'dd_dropdowns' => array('countryID','stateID','cityID'),
    //SETUP URL POST FOR EACH CHILD
    //List in order as per above
    'dd_url' => array('', site_url().'/examples/get_states/', site_url().'/examples/get_cities/'),
    //LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS
    'dd_ajax_loader' => base_url().'ajax-loader.gif'
);
$output->dropdown_setup = $dd_data;

 

Step 2: Copy the ‘dependent_dropdown.php’ to your views folder.

The ‘dependent_dropdown.php’ file containts all the PHP code that will dynamically create the dropdown file for you.

 

Step 3: Load the view in the view/display file.

Load the following PHP code in the view (at the bottom), the same one that gets used by GCRUD to create the output, css and js files.

if(isset($dropdown_setup)) {
	$this->load->view('dependent_dropdown', $dropdown_setup);
}

 

That’s it! Now you can successfully create dependent dropdown files.

View a LIVE demo here.

Download this example here




19
Mar

The CodeIgniter CRUD – GroceryCRUD

I’ve been working with Grocery CRUD the last few weeks and it is honestly the best CRUD I have worked with and really easy to use. Grocery CRUD (CRUD = Create, Read, Update and Delete) is a library that makes a developer’s life easier. Just few lines of code and you can create a full stable CRUD with nice views. A totally automatic system that even a newbie in PHP can work with.

As a php web developer you will often have the problem to create a simple, stable and secure backoffice system. How many CRUD different did you create for you customers? I suppose many . How much time did you spend to create them? It actually takes a lot of time (sometimes weeks) to create all the business logic, the models and the views again from the beginning for each table. As you can see there are similar things in those projects. The Create (or else Add) the Update (or else Edit) , the Delete and of course the listing grid .

 

With grocery CRUD and with the power of Codeigniter framework , you can create a full CRUD system in just one minute. With this Codeigniter CRUD generator , you don’t have to copy all your css, JavaScripts, tables, forms, grid, functions , models, libraries, views again and again to your backoffice system. Just few lines of code and you are ready to have your own CMS. The CRUD is working well with Codeigniter 2.0.x and 2.1.x

 

Here is a simple example of a short few lines of code:

function offices()
{
    $output = $this->grocery_crud->render();

    $this->_example_output($output);
}

The above the code will produce the following:

Grocery CRUD - CodeIgniter CRUD

In the example above the set table name (offices) get the default Crud with add-edit and delete (create-update-delete). All the views are ready and you don’t need anything else.

If you’re using CodeIgniter 2.x then give Grocery CRUD a go, seriously worth your while and speeds up your productivity so much.

The Grocery CRUD website: www.grocerycrud.com

Live Grocery CRUD examples: www.grocerycrud.com/examples

Grocery CRUD support: forums




© Copyright 2010-2013 KaBaDaBrA. All rights reserved. Created by Dream-Theme — premium wordpress themes. Proudly powered by WordPress.

Switch to our mobile site