Hello,
I would like to know if this free download grocerycrud has any database ? I have check the code and wonder if there is any? The model is empty. But in the controller it loads the databases.
http://www.grocerycrud.com/image-crud
controllers/images_examples.php
PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Images_examples extends CI_Controller {
function __construct()
{
parent::__construct();
/* Standard Libraries */
$this->load->database();
/* ------------------ */
$this->load->helper('url'); //Just for the examples, this is not required thought for the library
$this->load->library('image_CRUD');
}
function _example_output($output = null)
{
$this->load->view('example.php',$output);
}
function index()
{
$this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
}
function example1()
{
$image_crud = new image_CRUD();
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_table('example_1')
->set_image_path('assets/uploads');
$output = $image_crud->render();
$this->_example_output($output);
}
function example2()
{
$image_crud = new image_CRUD();
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_table('example_2')
->set_ordering_field('priority')
->set_image_path('assets/uploads');
$output = $image_crud->render();
$this->_example_output($output);
}
function example3()
{
$image_crud = new image_CRUD();
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_table('example_3')
->set_relation_field('category_id')
->set_ordering_field('priority')
->set_image_path('assets/uploads');
$output = $image_crud->render();
$this->_example_output($output);
}
function example4()
{
$image_crud = new image_CRUD();
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_title_field('title');
$image_crud->set_table('example_4')
->set_ordering_field('priority')
->set_image_path('assets/uploads');
$output = $image_crud->render();
$this->_example_output($output);
}
function simple_photo_gallery()
{
$image_crud = new image_CRUD();
$image_crud->unset_upload();
$image_crud->unset_delete();
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_table('example_4')
->set_image_path('assets/uploads');
$output = $image_crud->render();
$this->_example_output($output);
}
}
Please help me understand the program?
Second, can anyone recommend me a good tutorial to create my own library with CI ? Start with the simple one.
Thanks in advance.
" If I looks more intelligence please increase my reputation."