⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Image Crud Like Category Functinality



Terence Vusile Silonda
  • profile picture
  • Member

Posted 10 January 2013 - 09:42 AM

In Image Crud, I can pass to it a "category_id" in the url, and it will get images with that category, and any images I upload, will be saved with that category.

For example, my table (images) is structured as below:

id
url
title
category
priority


My images function is as below:



function images()
{
$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('images')
->set_ordering_field('priority')
->set_relation_field('category')
->set_image_path('images');

$output = $image_crud->render();

$this->_example_images_output($output);
}



if I go to this url > http://localhost/sit...roller/images/1

Image crud would get all images with category 1, and any upload I make will be automatically saved with category 1,

is it possible to do the such in GC? The method i currently use is callbacks. In the callback, I get that part of the url and then update the table.